I am using the R package CARBayesST to fit a Spatial-temporal Bayesian models. I want to use piece-wise ST model proposed by Lee and Lawson, 2017.

The package does not have a built-in predict function. I saw this post, how to predict for new data points using posterior probability distribution, but I am not able to construct the same for Spatial temporal Bayesian models. Any suggestion would be really appreciated.

There is even a github page for CARBayesST created by @Spacedman, but I couldn't figure out how to predict using the code. In case that helps in finding a solution.


1 Answer 1


You need to include the new data points with NA values for the response variable, in your training set. The model will calculate posterior probability distribution for them using data augmentation. If you save your model in the object model, you can access those posterior distributions through model$samples$Y. Unfortunately, this is only possible with ST.CARlinear(), ST.CARanova() and ST.CARar(), and not for the piece-wise model.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.