samplesDensity {BRugs} | R Documentation |
Plot density estimate or histogram
Description
This function plots a smoothed kernel density estimate for a variable if it is continuous or a histogram if it is discrete.
Usage
samplesDensity(node, beg = samplesGetBeg(), end = samplesGetEnd(),
firstChain = samplesGetFirstChain(),
lastChain = samplesGetLastChain(), thin = samplesGetThin(),
plot = TRUE, mfrow = c(3, 2), ask = NULL, ann = TRUE, ...)
Arguments
node |
Character vector of length 1, name of a variable in the model. |
beg , end |
Arguments to select a slice of monitored values corresponding to iterations |
firstChain , lastChain |
Arguments to select a sub group of chains to plot density estimate or histogram for. |
thin |
to only use every |
plot |
Logical, whether to plot the trace or only return density estimates.
If |
mfrow , ask , ann |
Graphical parameters, see |
... |
Further graphical parameters as in |
Details
If the variable of interest is an array, slices of the array can be selected using the notation
variable[lower0:upper0, lower1:upper1, ...]
.
A star ‘*
’ can be entered as shorthand for all the stored samples.
If the arguments are left at their defaults the whole sample for all chains will be used for calculation.
Note
If the MCMC simulation has an adaptive phase it will not be possible to make inference using values sampled before the end of this phase.