plot.abc {abc} | R Documentation |
Diagnostic plots for ABC
Description
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.
Usage
## S3 method for class 'abc'
plot(x, param, subsample = 1000, true = NULL, file = NULL,
postscript = FALSE, onefile = TRUE, ask =
!is.null(deviceIsInteractive()), ...)
Arguments
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 |
Details
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)).
See Also
Examples
## see ?abc for examples