The $variable_skeleton() method returns the variable skeleton needed by utils::relist() to re-structure a vector of constrained parameter values to a named list.

variable_skeleton(transformed_parameters = TRUE, generated_quantities = TRUE)

Arguments

transformed_parameters

(logical) Whether to include transformed parameters in the skeleton (defaults to TRUE).

generated_quantities

(logical) Whether to include generated quantities in the skeleton (defaults to TRUE).

Examples

# \dontrun{
fit_mcmc <- cmdstanr_example("logistic", method = "sample", force_recompile = TRUE)
fit_mcmc$variable_skeleton()
#> $alpha
#> [1] 0
#> 
#> $beta
#> [1] 0 0 0
#> 
#> $log_lik
#>   [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>  [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>  [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 
# }