samplesStats {BRugs}  R Documentation 
Calculate summary statistics
Description
This function produces summary statistics for a variable, pooling over the chains selected.
Usage
samplesStats(node, beg = samplesGetBeg(), end = samplesGetEnd(),
firstChain = samplesGetFirstChain(),
lastChain = samplesGetLastChain(), thin = samplesGetThin())
Arguments
node 
Character vector containing names of variables 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 calculate summary statistics for. 
thin 
to only use every 
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.
Value
samples.stats
returns a data frame with columns:
mean 
means 
sd 
standard deviations 
MC_error 
Estimate of 
val2.5pc 
0.025 quantiles 
median 
medians 
val97.5pc 
0.975 quantiles 
start 

sample 
sample sizes 
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.
References
Roberts, G.O. (1996): Markov Chain Concepts Related to Sampling Algorithms. In: W.R. Gilks, S. Richardson and D.J. Spiegelhalter (Eds.): Markov Chain Monte Carlo in Practice. Chapman and Hall, London, UK.