Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.HorseRulemodel

predict.hs


Description

Predict unseen data with the horseshoe model.

Usage

## 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

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

Flexible Non-Linear Regression with the HorseRule Algorithm

v1.0.0
GPL-3
Authors
Malte Nalenz <malte.nlz@googlemail.com>, Mattias Villani <mattias.villani@liu.se>
Initial release
2018-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.