predict.bayeslm.fit {bayeslm} | R Documentation |
predict.bayeslm.fit
is an S3 method to predict response on new data.
## S3 method for class 'bayeslm.fit'
predict(object,data,burnin,X,...)
object |
|
data |
A data frame or list of new data to predict. |
burnin |
number of draws to burn-in (default value is |
X |
If call |
... |
optional arguments for generic function. |
Make prediction on new data set, users are allowed to adjust number of burn-in samples.
Jingyu He
x = matrix(rnorm(1000), 100, 10)
y = x %*% rnorm(10) + rnorm(100)
data = list(x = x, y = y)
# Train the model with formula input
fit1 = bayeslm(y ~ x, data = data)
# predict
pred1 = predict(fit1, data)
# Train the model with matrices input
fit2 = bayeslm(Y = y, X = x)
pred2 = predict(fit2, X = x)