predict.BayesSUR {BayesSUR} | R Documentation |
predict method for class BayesSUR
Description
Predict responses corresponding to the posterior mean of the coefficients,
return posterior mean of coefficients or indices of nonzero coefficients of
a BayesSUR
class object.
Usage
## S3 method for class 'BayesSUR'
predict(object, newx, type = "response", beta.type = "marginal", Pmax = 0, ...)
Arguments
object |
an object of class |
newx |
Matrix of new values for x at which predictions are to be made |
type |
Type of prediction required. |
beta.type |
the type of estimated coefficients beta for prediction.
Default is |
Pmax |
If |
... |
other arguments |
Value
Predicted values extracted from an object of class BayesSUR
.
If the BayesSUR
specified data standardization, the fitted values
are base based on standardized data.
Examples
data("exampleEQTL", package = "BayesSUR")
hyperpar <- list(a_w = 2, b_w = 5)
set.seed(9173)
fit <- BayesSUR(
Y = exampleEQTL[["blockList"]][[1]],
X = exampleEQTL[["blockList"]][[2]],
data = exampleEQTL[["data"]], outFilePath = tempdir(),
nIter = 20, burnin = 10, nChains = 1, gammaPrior = "hotspot",
hyperpar = hyperpar, tmpFolder = "tmp/"
)
## check prediction
predict.val <- predict(fit, newx = exampleEQTL[["blockList"]][[2]])