post_predict | R Documentation |
Function to extract posterior predictions from an HPR model. Note that these are posterior predictions; if you want estimates of the estimated trajectory f (the systematic model component), use get_preds.
post_predict(object = NULL, alpha = 0.05)
object |
The results object from a run of hpr, for which a new_X and new_Z matrix were input. |
alpha |
The uncertainty level for posterior prediction intervals; the default is 0.05 (which corresponds to 95% prediction intervals). |
A dataframe with N_new rows (corresponding to the values of new_X, new_Z) and columns:
the mean of the posterior prediction samples
the median of the posterior prediction samples
the alpha/2 percentile of the posterior prediction samples
the 1-alpha/2 percentile of the posterior prediction samples
X <- as.matrix(dat$Day, ncol = 1)
y <- dat$Temperature
mymodel <- hpr(y = y, X = X, family = "gaussian", new_X = X)
post_preds <- post_predict(mymodel)
post_preds$x <- dat$Day
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.