get_preds: Function to extract f, the systematic component of an HPR...

View source: R/get_preds.R

get_predsR Documentation

Function to extract f, the systematic component of an HPR model

Description

Function to extract the estimated value of f (the systematic component of the model) from an HPR model. For posterior predictions, use post_predict.

Usage

get_preds(object = NULL, alpha = 0.05)

Arguments

object

The results object from a run of hpr.

alpha

The uncertainty level for the values of f; the default is 0.05 (which corresponds to 95% credible intervals).

Value

A dataframe with N rows (corresponding to the rows of X, Z) and columns:

Mean

the mean of the posterior samples of f

Median

the median of the posterior samples of f

Lower

the alpha/2 percentile of the posterior samples of f

Upper

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

Examples

X <- as.matrix(dat$Day, ncol = 1)
y <- dat$Temperature

mymodel <- hpr(y = y, X = X, family = "gaussian")
my_f <- get_preds(mymodel)
my_f$x <- dat$Day


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