Skip to contents

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 target log density (lp__) evaluated by Stan.
$init()Return user-specified initial values.
$metadata()Return a list of metadata gathered from the CmdStan CSV files.
$output_files()Return paths to output CSV files.
$save_output_files()Save output CSV files to a specified location.
$data_file()Return the path to the JSON data file.
$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, CmdStanLaplace, CmdStanMCMC, CmdStanMLE, CmdStanPathfinder, CmdStanVB

Examples

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

# retrieve the gradients
test$gradients()
#>   param_idx     value     model finite_diff        error
#> 1         0 -1.805980  39.42980    39.42980  1.18938e-08
#> 2         1  1.310900 -26.80310   -26.80310  1.39047e-08
#> 3         2 -0.831514   1.21605     1.21605 -1.98358e-09
#> 4         3  0.779365   2.82837     2.82837  9.14719e-09
# }