predict.HorseRulemodel: predict.hs

Description Usage Arguments Value Examples

Description

Predict unseen data with the horseshoe model.

Usage

1
2
3
## S3 method for class 'HorseRulemodel'
predict(object, newdata, burnin = 100,
  postmean = TRUE, ...)

Arguments

object

list containing a model of class "hs_rulefit".

newdata

Dataframe containing the unseen data to predict.

burnin

Number of samples that is disregarded as burnin. Increase number in case of slow convergence.

postmean

If true returns the Predictive-Posterior mean value. If False returns the full predictive posterior distribution.

...

additional arguments

Value

Returns the predictive posterior distribution matrix. Column i contains the predictive posterior of observation i.

Examples

1
2
3
4
5
x = matrix(rnorm(1000), ncol=10)
y = apply(x,1,function(x)sum(x[1:5])+rnorm(1))
hrresmod = HorseRuleFit(X=x, y=y, niter=100, burnin=10)
#predict training data to obtain the fitted values
predict(hrresmod, x, burnin=10)

horserule documentation built on May 2, 2019, 10:04 a.m.