A CmdStanDiagnose object is the object returned by the $diagnose() method of a CmdStanModel object.

Methods

CmdStanDiagnose objects have the following associated methods:

MethodDescription
$gradients()Return gradients from diagnostic mode.
$lp()Return the total log probability density (target).
$init()Return user-specified initial values.
$metadata()Return a list of metadata gathered from the CmdStan CSV files.
$save_output_files()Save output CSV files to a specified location.
$save_data_file()Save JSON data file to a specified location.

See also

The CmdStanR website (mc-stan.org/cmdstanr) for online documentation and tutorials.

The Stan and CmdStan documentation:

Other fitted model objects: CmdStanGQ, CmdStanMCMC, CmdStanMLE, CmdStanVB

Examples

# \dontrun{
test <- cmdstanr_example("logistic", method = "diagnose")

# retrieve the gradients
test$gradients()
#>   param_idx     value    model finite_diff        error
#> 1         0 -0.185026 11.68660    11.68660 -2.89634e-09
#> 2         1 -1.579220 12.33760    12.33760  2.86842e-08
#> 3         2 -0.391481  4.28029     4.28029 -2.55717e-08
#> 4         3 -0.580364 18.08200    18.08200 -1.15854e-08
# }