predict.hs
Predict unseen data with the horseshoe model.
## S3 method for class 'HorseRulemodel' predict(object, newdata, burnin = 100, postmean = TRUE, ...)
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 |
Returns the predictive posterior distribution matrix. Column i contains the predictive posterior of observation i.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.