BayesSUR (version 1.1-2)

plot.Estimator: plot the posterior mean 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

# S3 method for Estimator
plot(
  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),
  title.beta = paste("Estimator", "$\\hat{\\bm{B}}$"),
  title.gamma = paste("Estimator", "$\\hat{\\mathbf{\\Gamma}}$"),
  title.Gy = paste("Estimator", "$\\hat{\\mathcal{G}}$"),
  cex.main = 1.5,
  ...
)

Arguments

x

an object of class getEstimator with estimator=c("beta","gamma","Gy")

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 "NA" only to show the locations. The value "auto" show the response names from the orginal data.

name.predictors

a vector of the predictor names. The default is "NA" only to show the locations. The value "auto" show the predictor names from the orginal data.

xlab

a title for the x axis

ylab

a title for the y axis

fig.tex

print the figure through LaTex. Default is "FALSE"

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 "FALSE"

mgp

the margin line (in mex units) for the axis title, axis labels and axis line

title.beta

a title for the printed "beta" if fig.tex=TRUE

title.gamma

a title for the printed "gamma" if fig.tex=TRUE

title.Gy

a title for the printed "Gy" if fig.tex=TRUE

cex.main

size of the title for each estimator

...

other arguments

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
# Plot the estimators from the fitted object
# }
# NOT RUN {
estimators <- getEstimator(fit, estimator = c("beta","gamma","Gy"))
plot(estimators)

#Set up temporary work directory for saving a pdf figure
td <- tempdir()
oldwd <- getwd()
setwd(td)

# Produce authentic math formulas in the graph
plot(estimators, fig.tex = TRUE)
system(paste(getOption("pdfviewer"), "ParamEstimator.pdf"))
setwd(oldwd)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace