as_mcmc: Return a CODA mcmc object with the required samples

Description Usage Arguments Value Selecting sample types Filtering samples Examples

View source: R/store.R

Description

Given a sampler object and a specification of the samples required, return either an individual coda mcmc object, or a list of mcmc objects.

Usage

1
as_mcmc(sampler, selection = "theta_mu", filter = stages)

Arguments

sampler

The pmwgs object containing samples to extract.

selection

The selection of sample types to return.

filter

A filter that defines which stage to draw samples from.

Value

An mcmc object or list containing the selected samples.

Selecting sample types

The values that can be chosen for the selection argument can be one of the following list:

"theta_mu"

the model parameter estimate samples

"theta_sig"

the covariance matrix estimates, returns a list of mcmc objects, one for each model parameter.

"alpha"

the random effect estimates, returns a list of mcmc objects, one for each subject.

The default value for selection is "theta_mu"

Filtering samples

The filter argument can take one of two forms:

The default value for filter is all stages.

Examples

1
2
3
4
5
6
7
par_estimates <- as_mcmc(sampled_forstmann)
par_estimates_sample_stage <- as_mcmc(sampled_forstmann, filter = "sample")
rand_eff <- as_mcmc(
  sampled_forstmann,
  selection = "alpha",
  filter = "sample"
)

pmwg documentation built on Feb. 17, 2021, 9:07 a.m.