predict.varbvs {varbvs} | R Documentation |
Make predictions from a model fitted by varbvs.
Description
This function predicts outcomes (Y) given the observed
variables (X) and observed covariates (Z), and a model fitted using
varbvs
.
Usage
## S3 method for class 'varbvs'
predict(object, X, Z = NULL,
type = c("link","response","class"),
averaged = TRUE, ...)
Arguments
object |
Output of function |
X |
n x p input matrix, in which p is the number of variables, and n is the number of samples for which predictions will be made using the fitted model. X cannot be sparse, and cannot have any missing values (NA). |
Z |
n x m covariate data matrix, where m is the number of
covariates. Do not supply an intercept as a covariate (i.e., a
column of ones), because an intercept is automatically included in
the regression model. For no covariates, set |
type |
Type of prediction to output. The default, "link", gives
the linear predictors for |
averaged |
When |
... |
Other arguments to generic predict function. These extra arguments are not used here. |
Details
Note that the classification probabilities Pr(Y = 1 | X, Z,
\theta)
are not guaranteed to be calibrated under the variational
approximation.
Value
When averaged = TRUE
, the output is a vector containing the
predicted outcomes for all samples. For family = "binomial"
,
all vector entries are 0 or 1.
When averaged = FALSE
, the return value is a matrix with one
row for each sample, and one column for each hyperparameter setting.
Author(s)
Peter Carbonetto peter.carbonetto@gmail.com
References
P. Carbonetto and M. Stephens (2012). Scalable variational inference for Bayesian variable selection in regression, and its accuracy in genetic association studies. Bayesian Analysis 7, 73–108.
See Also
Examples
# See help(varbvs) for examples.