| plotCPO {BayesSUR} | R Documentation |
plot 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
plotCPO(
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 |
outlier.mark |
mark the outliers with the response names.
The default is |
outlier.thresh |
threshold for the CPOs. The default is 0.01. |
scale.CPO |
scaled CPOs which is divided by their maximum.
The default is |
x.loc |
a vector of features distance |
axis.label |
a vector of predictor names which are shown in CPO plot.
The default is |
las |
graphical parameter of plot.default |
cex.axis |
graphical parameter of plot.default |
mark.pos |
location of the marked text relative to the point |
mark.color |
color of the marked text. The default color is red |
mark.cex |
font size of the marked text. The default font size 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–161. Chapman & Hall, Boca Raton, FL.
Congdon P. (2005). Bayesian Models for Categorical Data. John Wiley & Sons, West Sussex, England.
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/", output_CPO = TRUE
)
## check output
# plot the conditional predictive ordinate (CPO)
plotCPO(fit)