extract_draws {rbmi} | R Documentation |
Extract draws from a stanfit
object
Description
Extract draws from a stanfit
object and convert them into lists.
The function rstan::extract()
returns the draws for a given parameter as an array. This function
calls rstan::extract()
to extract the draws from a stanfit
object
and then convert the arrays into lists.
Usage
extract_draws(stan_fit, n_samples)
Arguments
stan_fit |
A |
n_samples |
Number of MCMC draws. |
Value
A named list of length 2 containing:
-
beta
: a list of length equal ton_samples
containing the draws from the posterior distribution of the regression coefficients. -
sigma
: a list of length equal ton_samples
containing the draws from the posterior distribution of the covariance matrices. Each element of the list is a list with length equal to 1 ifsame_cov = TRUE
or equal to the number of groups ifsame_cov = FALSE
.
[Package rbmi version 1.4.1 Index]