plotEstimator {BayesSUR} | R Documentation |
plot heatmap of estimators
Description
Plot the posterior mean estimators from a BayesSUR
class object,
including the coefficients beta, latent indicator variable gamma and
graph of responses.
Usage
plotEstimator(
x,
estimator = NULL,
colorScale.gamma = grey((100:0)/100),
colorScale.beta = c("blue", "white", "red"),
legend.cex.axis = 1,
name.responses = NA,
name.predictors = NA,
xlab = "",
ylab = "",
fig.tex = FALSE,
output = "ParamEstimator",
header = "",
header.cex = 2,
tick = FALSE,
mgp = c(2.5, 1, 0),
cex.main = 1.5,
title.beta = NA,
title.gamma = NA,
title.Gy = NA,
beta.type = "marginal",
Pmax = 0,
...
)
Arguments
x |
an object of class |
estimator |
print the heatmap of estimators. The value "beta" is for the estimated coefficients matrix, "gamma" for the latent indicator matrix and "Gy" for the graph of responses |
colorScale.gamma |
value palette for gamma |
colorScale.beta |
a vector of three colors for diverging color schemes |
legend.cex.axis |
magnification of axis annotation relative to cex |
name.responses |
a vector of the response names. The default is
|
name.predictors |
a vector of the predictor names. The default is
|
xlab |
a title for the x axis |
ylab |
a title for the y axis |
fig.tex |
print the figure through LaTex. Default is |
output |
the file name of printed figure |
header |
the main title |
header.cex |
size of the main title for all estimators |
tick |
a logical value specifying whether tickmarks and an axis line
should be drawn. Default is |
mgp |
the margin line (in mex units) for the axis title, axis labels and axis line |
cex.main |
size of the title for each estimator |
title.beta |
a title for the printed "beta" |
title.gamma |
a title for the printed "gamma" |
title.Gy |
a title for the printed "Gy" |
beta.type |
the type of output beta. Default is |
Pmax |
threshold that truncate the estimator " |
... |
other arguments |
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
# Plot the estimators from the fitted object
plotEstimator(fit, estimator = c("beta", "gamma", "Gy"))
## Not run:
## Set up temporary work directory for saving a pdf figure
# td <- tempdir()
# oldwd <- getwd()
# setwd(td)
## Produce authentic math formulas in the graph
# plotEstimator(fit, estimator = c("beta", "gamma", "Gy"), fig.tex = TRUE)
# system(paste(getOption("pdfviewer"), "ParamEstimator.pdf"))
# setwd(oldwd)
## End(Not run)