# How to predict using Spatial temporal hierarchical bayesian models

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.

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.