plot.abc | R Documentation |
A plotting utile for quick visualization of the quality of an ABC
analysis from an object of class "abc"
generated with methods
"loclinear"
or "neuralnet"
(see abc
for
details). Four plots are currently available: a density plot of the
prior distribution, a density plot of the posterior distribution, a
scatter plot of the Euclidean distances as a function of the parameter
values, and a Normal Q-Q plot of the residuals from the
regression.
## S3 method for class 'abc' plot(x, param, subsample = 1000, true = NULL, file = NULL, postscript = FALSE, onefile = TRUE, ask = !is.null(deviceIsInteractive()), ...)
x |
an object of class |
param |
a vector or matrix of parameter values from the simulations that
were used in the original call to |
subsample |
the number of rows (simulations) to be plotted. Rows are randomly
selected from |
true |
a vector of true parameter values, if known. Vertical lines are drawn at these values. |
file |
a character string giving the name of the file. See
|
postscript |
logical; if |
onefile |
logical, if |
ask |
logical; if |
... |
other parameters passed to |
In order to use this function, one of the regression correction
methods had to be used in the original call to abc
,
i.e. "loclinear"
or "neuralnet"
(see abc
for details). Four plots are printed for each parameter. (i) A density
plot of the prior distribution. (ii) A density plot of the posterior
distribution using the regression correction (red thick lines) and,
for reference, using the simple rejection method (black fine
lines). The prior distribution (in the posterior distributions' range)
is also displayed (dashed lines). (iii) A scatter plot of the log
Euclidean distances as a function of the true parameter values. Points
corresponding to the accepted simulations are displayed in red. (iv) A
Normal Q-Q plot of the residuals from the regression, thus from
lsfit
when method was "loclinear"
, and from
nnet
when method was "neuralnet"
in the original
abc
.
For plots (i) and (iii) not the whole data but a subsample is used,
the size of which can be is given by subsample
. This is to
avoid plots that may take too much time to print.
If a parameter transformation was applied in the original call to
abc
, the same transformations are applied to the
parameters for plotting (on plots (i)-(iii)).
abc
, hist.abc
, summary.abc
## see ?abc for examples
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.