18 Diagnostic Mode

Stan’s diagnostic mode runs a Stan program with data, initializing parameters either randomly or with user-specified initial values, and then evaluates the log probability and its gradients. The gradients computed by the Stan program are compared to values calculated by finite differences.

Diagnostic mode may be configured with two parameters.

Diagnostic Mode Configuration Table. The diagnostic model configuration parameters, constraints, and default values.

parameter description constraints default
epsilon finite difference size (0, infty) 1e–6
error error threshold for matching (0, infty) 1e–6

If the difference between the Stan program’s gradient value and that calculated by finite difference is higher than the specified threshold, the argument will be flagged.