predict.IBIS {UNCOVER} | R Documentation |
Prediction method for IBIS
Description
Predicts the response of new observations using an object of
class "IBIS"
.
Usage
## S3 method for class 'IBIS'
predict(object, newX = NULL, type = "prob", ...)
Arguments
object |
Object of class |
newX |
Data frame containing new observations to predict. If not specified the fitted values will be returned instead. |
type |
Either |
... |
Additional arguments affecting the predictions produced |
Details
Note that this is a Bayesian prediction method as objects with
class "IBIS"
will provide samples from a posterior.
Value
Either a matrix of response probabilities for each observation or a vector of predicted responses for each observation.
See Also
Examples
# First we generate a co-variate matrix X and binary response vector y
CM <- data.frame(X1 = rnorm(100),X2 = rnorm(100))
rv <- sample(0:1,100,replace=TRUE)
# Now we can obtain 1000 samples from the posterior from a standard
# multivariate normal prior
out <- IBIS.logreg(X = CM,y = rv)
# The fitted values of out can be obtained
predict(out)
predict(out,type = "response")
# We can also predict the response for new data
CM.2 <- data.frame(X1 = rnorm(10),X2 = rnorm(10))
cbind(CM.2,predict(out,newX = CM.2))
[Package UNCOVER version 1.1.0 Index]