The $metadata() method returns a list of information gathered from the CSV output files, including the CmdStan configuration used when fitting the model. See Examples and read_cmdstan_csv().

metadata()

See also

Examples

# \dontrun{ fit_mcmc <- cmdstanr_example("logistic", method = "sample")
#> Model executable is up to date!
str(fit_mcmc$metadata())
#> List of 33 #> $ stan_version_major : num 2 #> $ stan_version_minor : num 25 #> $ stan_version_patch : num 0 #> $ method : chr "sample" #> $ save_warmup : num 0 #> $ thin : num 1 #> $ gamma : num 0.05 #> $ kappa : num 0.75 #> $ t0 : num 10 #> $ init_buffer : num 75 #> $ term_buffer : num 50 #> $ window : num 25 #> $ algorithm : chr "hmc" #> $ engine : chr "nuts" #> $ metric : chr "diag_e" #> $ stepsize_jitter : num 0 #> $ id : num [1:4] 1 2 3 4 #> $ init : num [1:4] 2 2 2 2 #> $ seed : num [1:4] 7.77e+07 2.10e+09 1.87e+09 1.79e+09 #> $ refresh : num 100 #> $ sig_figs : num -1 #> $ sampler_diagnostics : chr [1:6] "accept_stat__" "stepsize__" "treedepth__" "n_leapfrog__" ... #> $ model_params : chr [1:105] "lp__" "alpha" "beta[1]" "beta[2]" ... #> $ step_size_adaptation: num [1:4] 0.729 0.751 0.632 0.796 #> $ model_name : chr "logistic_model" #> $ adapt_engaged : num 1 #> $ adapt_delta : num 0.8 #> $ max_treedepth : num 10 #> $ step_size : num [1:4] 1 1 1 1 #> $ iter_warmup : num 1000 #> $ iter_sampling : num 1000 #> $ stan_variable_dims :List of 4 #> ..$ lp__ : num 1 #> ..$ alpha : num 1 #> ..$ beta : num 3 #> ..$ log_lik: num 100 #> $ stan_variables : chr [1:4] "lp__" "alpha" "beta" "log_lik"
fit_mle <- cmdstanr_example("logistic", method = "optimize")
#> Model executable is up to date!
str(fit_mle$metadata())
#> List of 24 #> $ stan_version_major : num 2 #> $ stan_version_minor : num 25 #> $ stan_version_patch : num 0 #> $ method : chr "optimize" #> $ algorithm : chr "lbfgs" #> $ init_alpha : num 0.001 #> $ tol_obj : num 1e-12 #> $ tol_rel_obj : num 10000 #> $ tol_grad : num 1e-08 #> $ tol_rel_grad : num 1e+07 #> $ tol_param : num 1e-08 #> $ history_size : num 5 #> $ iter : num 2000 #> $ save_iterations : num 0 #> $ id : num 1 #> $ init : num 2 #> $ seed : num 1.1e+09 #> $ refresh : num 100 #> $ sig_figs : num -1 #> $ sampler_diagnostics: chr(0) #> $ model_params : chr [1:105] "lp__" "alpha" "beta[1]" "beta[2]" ... #> $ model_name : chr "logistic_model" #> $ stan_variable_dims :List of 4 #> ..$ lp__ : num 1 #> ..$ alpha : num 1 #> ..$ beta : num 3 #> ..$ log_lik: num 100 #> $ stan_variables : chr [1:4] "lp__" "alpha" "beta" "log_lik"
fit_vb <- cmdstanr_example("logistic", method = "variational")
#> Model executable is up to date!
str(fit_vb$metadata())
#> List of 23 #> $ stan_version_major : num 2 #> $ stan_version_minor : num 25 #> $ stan_version_patch : num 0 #> $ method : chr "variational" #> $ algorithm : chr "meanfield" #> $ iter : num 50 #> $ grad_samples : num 1 #> $ elbo_samples : num 100 #> $ eta : num 1 #> $ tol_rel_obj : num 0.01 #> $ eval_elbo : num 100 #> $ output_samples : num 1000 #> $ id : num 1 #> $ init : num 2 #> $ seed : num 2.03e+09 #> $ refresh : num 100 #> $ sig_figs : num -1 #> $ sampler_diagnostics: chr(0) #> $ model_params : chr [1:106] "lp__" "lp_approx__" "alpha" "beta[1]" ... #> $ model_name : chr "logistic_model" #> $ adapt_engaged : num 1 #> $ stan_variable_dims :List of 5 #> ..$ lp__ : num 1 #> ..$ lp_approx__: num 1 #> ..$ alpha : num 1 #> ..$ beta : num 3 #> ..$ log_lik : num 100 #> $ stan_variables : chr [1:5] "lp__" "lp_approx__" "alpha" "beta" ...
# }