Learn R Programming

LaplacesDemon (version 16.1.1)

plot.laplace: Plot the output of LaplaceApproximation

Description

This may be used to plot, or save plots of, the iterated history of the parameters and, if posterior samples were taken, density plots of parameters and monitors in an object of class laplace.

Usage

# S3 method for laplace
plot(x, Data, PDF=FALSE, Parms, …)

Arguments

x

This required argument is an object of class laplace.

Data

This required argument must receive the list of data that was supplied to LaplaceApproximation to create the object of class laplace.

PDF

This logical argument indicates whether or not the user wants Laplace's Demon to save the plots as a .pdf file.

Parms

This argument accepts a vector of quoted strings to be matched for selecting parameters for plotting. This argument defaults to NULL and selects every parameter for plotting. Each quoted string is matched to one or more parameter names with the grep function. For example, if the user specifies Parms=c("eta", "tau"), and if the parameter names are beta[1], beta[2], eta[1], eta[2], and tau, then all parameters will be selected, because the string eta is within beta. Since grep is used, string matching uses regular expressions, so beware of meta-characters, though these are acceptable: ".", "[", and "]".

Additional arguments are unused.

Details

The plots are arranged in a \(2 \times 2\) matrix. The purpose of the iterated history plots is to show how the value of each parameter and the deviance changed by iteration as the LaplaceApproximation attempted to maximize the logarithm of the unnormalized joint posterior density. If the algorithm converged, and if sir=TRUE in LaplaceApproximation, then plots are produced of selected parameters and all monitored variables.

See Also

LaplaceApproximation

Examples

Run this code
# NOT RUN {
### See the LaplaceApproximation function for an example.
# }

Run the code above in your browser using DataLab