Diagnostics¶
mgsl.Failures
¶
Bases: NamedTuple
Solver failure counts per path, always recorded.
Each field is an integer array of shape (n_paths,), summed over all fits of the call.
Non-zero counts mean some results rest on unconverged or failed numerics.
Attributes:
| Name | Type | Description |
|---|---|---|
draw_cg_capped |
array
|
Residual-draw CG solves that stopped at |
newton_cg_capped |
array
|
Newton CG solves that stopped at |
cg_breakdowns |
array
|
CG solves stopped by non-positive curvature or non-finite values: the Fisher information is not positive semi-definite or the model returned NaN/inf. |
sd_fallbacks |
array
|
Newton steps where the CG direction was not a descent direction and steepest descent was used instead. |
line_search_failures |
array
|
Newton steps where the line search found no decrease although one was predicted. |
nonfinite |
array
|
Fits whose objective was not finite at the starting centre: the path cannot move ("frozen"), typically NaN data or a log-likelihood undefined there. |
mgsl.MGSLDiagnostics
dataclass
¶
Per-path diagnostics of a run (numpy arrays only).
Attributes:
| Name | Type | Description |
|---|---|---|
taus |
ndarray
|
|
tau_end |
float
|
Observation time reached after the last step. |
ess_fraction |
ndarray
|
|
newton_iter |
ndarray
|
|
cg_newton, cg_draws |
CGStats
|
Fields of shape |
terminal |
FitDiagnostics or None
|
The terminal fit at |
concatenate(a, b)
staticmethod
¶
Join a run and its continuation along the step axis (terminal taken from b).
mgsl.FitDiagnostics
¶
Bases: NamedTuple
Diagnostics of a set of local fits (arrays with leading axis paths).
Attributes:
| Name | Type | Description |
|---|---|---|
ess_fraction |
array
|
Effective sample size |
newton_iter |
array
|
Newton steps taken per fit (all rounds). |
cg_newton, cg_draws |
CGStats
|
Newton and residual-draw CG statistics. |
mgsl.CGStats
¶
Bases: NamedTuple
Statistics of the CG solves of each fit (arrays shaped like the fits).
Attributes:
| Name | Type | Description |
|---|---|---|
mean_iter, max_iter |
array
|
Mean and maximum iterations per solve. |
max_rel_residual |
array
|
Largest |
cap_fraction |
array
|
Fraction of solves that stopped at |