get_H: Function to extract the nonlinear component of an HPR model,...

View source: R/get_H.R

get_HR Documentation

Function to extract the nonlinear component of an HPR model, in the presence of augmented data

Description

Function to extract the estimated value of the horseshoe component of the model from an HPR model in the presence of augmented data. If there are no augmented data, use get_preds. For posterior predictions, use post_predict.

Usage

get_H(object = NULL, alpha = 0.05)

Arguments

object

The results object from a run of hpr.

alpha

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

Value

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

Mean

the mean of the posterior samples of the horseshoe component

Median

the median of the posterior samples of the horseshoe component

Lower

the alpha/2 percentile of the posterior samples of the horseshoe component

Upper

the 1-alpha/2 percentile of the posterior samples of the horseshoe component

Examples

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

mymodel <- hpr(y = y, X = X, family = "gaussian")
my_H <- get_H(mymodel)


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