post_predict: Function to extract posterior predictions from an HPR model....

View source: R/post_predict.R

post_predictR 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.

Description

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.

Usage

post_predict(object = NULL, alpha = 0.05)

Arguments

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).

Value

A dataframe with N_new rows (corresponding to the values of new_X, new_Z) and columns:

Mean

the mean of the posterior prediction samples

Median

the median of the posterior prediction samples

Lower

the alpha/2 percentile of the posterior prediction samples

Upper

the 1-alpha/2 percentile of the posterior prediction samples

Examples

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


elizabethchase/HPR documentation built on May 7, 2023, 5:48 a.m.