Learn R Programming

dRiftDM (version 0.3.1)

get_subset_chains: Extract a Subset of MCMC Chains

Description

When calling estimate_bayesian(), the MCMC results are packed up as an mcmc_dm object. This function is used in the depths of dRiftDM to extract the relevant array of MCMC samples, depending on whether the model is hierarchical and whether a participant ID is provided.

Usage

get_subset_chains(chains_obj, id = NULL)

Value

A 3D array of MCMC samples. The first dimension indicates parameters, the second dimension chains, and the third dimension iterations

Arguments

chains_obj

an object of classmcmc_dm.

id

an optional single numeric or character, specifying the ID of a participant to extract individual-level samples from a hierarchical model. Ignored for non-hierarchical models.