Skip to contents

Assembles a fitted model's posterior draws into an [iteration, chain, parameter] array – the layout expected by bayesplot and analogous to posterior::as_draws_array(). Multiple chains are recognised from a 3D draws array, a $chain_id row map, or an $n_chains count over chain-major rows; a single pooled chain yields a one-chain array.

Usage

tulpa_draws_array(fit)

Arguments

fit

A tulpa_fit (or subclass) carrying posterior $draws.

Value

A numeric array with dimensions [n_iter, n_chain, n_param] and the parameter names on the third dimension, or NULL if the fit carries no draws. Chains of unequal length are truncated to the shortest.

Details

As with posterior_sample(), a fit that carries no draws returns NULL with a message naming its backend and the representation it carries instead.