predict.BayesSUR: predict responses corresponding to the posterior mean of the...

Description Usage Arguments Value Examples

View source: R/predict.BayesSUR.R

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

1
2
3
4
5
6
7
8
## S3 method for class 'BayesSUR'
predict(
  object,
  newx,
  type = c("response", "coefficients", "nonzero"),
  Pmax = 0,
  ...
)

Arguments

object

an object of class "BayesSUR"

newx

Matrix of new values for x at which predictions are to be made. Must be a matrix

type

Type of prediction required. Type "response" gives the fitted responses. Type "coefficients" computes the coefficients truncated the estimated coefficients based on thresholding the estimated latent indicator variable at Pmax. Type "nonzero" returns a list of the indices of the nonzero coefficients corresponding to the estimated latent indicator variable thresholding at Pmax

Pmax

threshold that truncates the estimated coefficients based on thresholding the estimated latent indicator variable. Default is 0.

...

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("example_eQTL", package = "BayesSUR")
hyperpar <- list( a_w = 2 , b_w = 5 )

fit <- BayesSUR(Y = example_eQTL[["blockList"]][[1]], 
                X = example_eQTL[["blockList"]][[2]],
                data = example_eQTL[["data"]], outFilePath = tempdir(),
                nIter = 100, burnin = 50, nChains = 2, gammaPrior = "hotspot",
                hyperpar = hyperpar, tmpFolder = "tmp/" )

## check prediction
predict.val <- predict(fit, newx=example_eQTL[["blockList"]][[2]])

BayesSUR documentation built on Dec. 18, 2019, 1:42 a.m.