You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Newton optimizer produces NaN parameters for a target with a flat direction, no error raised #3425
make_negative_definite_and_solve divides by fabs(eigenvalues[i]) without checking for zeros (division at line 24). For a parameter absent from the target, the Hessian is zero and the step is 0/0:
// model whose log_prob ignores its single parameter, returns 0.5
stan::optimization::newton_step<flat_model, false>(model, params_r, params_i);
// f0 = 0.5, params_r[0] = -nan
The caller loop accepts NaN (while (f1 < f0) is false for NaN) and the service returns error_codes::OK without a finiteness check, so the run reports success with NaN parameters. Probably related to #3306.
Activity
shahd-elgouhary commentedon Sep 14, 2026
Can I take this issue, please?
WardBrian commentedon Sep 14, 2026
Hi @shahd-elgouhary - a patch is already in progress for this issue in #3429