BayesSUR (version 1.1-2)

getEstimator: extract the posterior mean of the parameters

Description

Extract the posterior mean of the parameters of a "BayesSUR" class object.

Usage

getEstimator(object, estimator = "gamma", Pmax = 0)

Arguments

object

an object of class "BayesSUR"

estimator

the name of one estimator. Default is the latent indicator estimator "gamma". Other options "beta", "Gy", "CPO" and "logP" correspond the posterior means of coefficient matrix, response graph and conditional predictive ordinate (CPO) respectively

Pmax

threshold that truncate the estimator. Default is 0. If the estimator is beta, then beta is truncated based on the latent indicator matrix shresholding at Pmax

Value

Return the one estimator from an object of class "BayesSUR". It is the posterior mean of the latent indicator variable if estimator="gamma", posterior mean of the regression coefficients if estimator="beta", posterior mean of the response graph if estimator="Gy" and the CPO if estimator="CPO",

Examples

Run this code
# NOT RUN {
data("example_eQTL", package = "BayesSUR")
hyperpar <- list( a_w = 2 , b_w = 5 )

set.seed(9173)
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 output
# extract the posterior mean of the coefficients matrix
beta_hat <- getEstimator(fit, estimator="beta")

# }

Run the code above in your browser using DataLab