getEstimator {BayesSUR} | R Documentation |
extract the posterior mean of parameters
Description
Extract the posterior mean of the parameters of a BayesSUR
class object.
Usage
getEstimator(object, estimator = "gamma", Pmax = 0, beta.type = "marginal")
Arguments
object |
an object of class |
estimator |
the name of one estimator. Default is the latent indicator
estimator " |
Pmax |
threshold that truncate the estimator " |
beta.type |
the type of output beta. Default is |
Value
Return the estimator from an object of class BayesSUR
. It is
a matrix if the length of argument marginal
is greater than 1.
Otherwise, it is a list
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 = 10, burnin = 0, nChains = 1, gammaPrior = "hotspot",
hyperpar = hyperpar, tmpFolder = "tmp/"
)
## check output
# extract the posterior mean of the coefficients matrix
beta_hat <- getEstimator(fit, estimator = "beta")