BayesSUR (version 1.1-2)

plot.CPO: plot the conditional predictive ordinate

Description

Plot the conditional predictive ordinate (CPO) for each individual of a fitted model generated by BayesSUR which is a "BayesSUR" object. CPO is a handy posterior predictive check because it may be used to identify outliers, influential observations, and for hypothesis testing across different non-nested models (Gelfand 1996).

Usage

# S3 method for CPO
plot(
  x,
  outlier.mark = TRUE,
  outlier.thresh = 0.01,
  scale.CPO = TRUE,
  x.loc = FALSE,
  axis.label = NULL,
  las = 0,
  cex.axis = 1,
  mark.pos = c(0, -0.01),
  mark.color = 2,
  mark.cex = 0.8,
  xlab = "Observations",
  ylab = NULL,
  ...
)

Arguments

x

an object of class getEstimator with estimator="CPO"

outlier.mark

mark the outliers with the response names. The default is FALSE

outlier.thresh

threshold for the CPOs. The default is 0.01.

scale.CPO

scaled CPOs which is divided by their maximum. The default is TRUE

x.loc

a vector of features distance

axis.label

a vector of predictor names which are shown in CPO plot. The default is NULL only showing the indices. The value "auto" show the predictor names from the orginal data.

las

graphical parameter of plot.default

cex.axis

graphical parameter of plot.default

mark.pos

the location of the marked text relative to the point

mark.color

the color of the marked text. The default color is red.

mark.cex

the fontsize of the marked text. The default fontsize is 0.8.

xlab

a title for the x axis

ylab

a title for the y axis

...

other arguments

Details

The default threshold for the CPOs to detect the outliers is 0.01 by Congdon (2005). It can be tuned by the argument outlier.thresh.

References

Statisticat, LLC (2013). Bayesian Inference. Farmington, CT: Statisticat, LLC.

Gelfand A. (1996). Model Determination Using Sampling Based Methods. In Gilks W., Richardson S., Spiegelhalter D. (eds.), Markov Chain Monte Carlo in Practice, pp. 145<U+2013>161. Chapman & Hall, Boca Raton, FL.

Congdon P. (2005). Bayesian Models for Categorical Data. John Wiley & Sons, West Sussex, England.

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/", output_CPO=TRUE)

## check output
# plot the conditional predictive ordinate (CPO)
CPO <- getEstimator(fit, estimator="CPO")
plot(CPO)

# }

Run the code above in your browser using DataLab