Learn R Programming

MCMCprecision (version 0.4.2)

summary.stationary: Summary for Posterior Model Probabilities

Description

Summary for a sample of posterior model probabilities (stationary). Also provides the estimated effective sample size and summaries for all pairwise Bayes factors.

Usage

# S3 method for stationary
summary(object, BF = FALSE, logBF = FALSE, ...)

Value

a list with estimates for

"pp" = posterior model probabilities,

"n.eff" = effective sample size, and

"bf" = pairwise Bayes factors (optional)

Arguments

object

posterior samples of the stationary distribution (rows = samples; columns = models).

BF

whether to compute summaries for all pairwise Bayes factors.

logBF

whether to summarize log Bayes factors instead of Bayes factors.

...

passed to fit_dirichlet to estimate effective sample size (e.g., maxit and abstol).

Details

Effective sample is estimated by fitting a Dirichlet model to the posterior model probabilities (thereby assuming that samples were drawn from an equivalent multinomial distribution based on independent sampling). More precisely, sample size is estimated by the sum of the Dirichlet parameters \(\sum\alpha[i]\) minus the prior sample size \(\epsilon*M^2\) (where \(M\) is the number of sampled models and \(\epsilon\) the prior parameter for each transition frequency).

See Also

stationary, fit_dirichlet

Examples

Run this code
P <- matrix(c(.1,.5,.4,
              0, .5,.5,
              .9,.1,0), ncol = 3, byrow=TRUE)
z <- rmarkov(1000, P)
samples <- stationary(z, summary = FALSE)
summary(samples)

Run the code above in your browser using DataLab