Built a large test bank for the discretization methods.
committed 04:00AM - 16 Sep 26 UTC
Organised by the PROCESS being discretized rather than by command, so every
meth… od that can handle a given process is run against the same analytic truth
and against each other. P0 instruments, P1 iid normal, P2 AR(1) normal, P3
AR(1) with gaussian-mixture innovations, P4 AR(1) with stochastic volatility,
P5 VAR(1), P6 life-cycle AR(1), P7 life-cycle AR(1) with gaussian mixture,
P8 life-cycle VAR(1), P9 a normal distribution on a given grid.
3051 checks over 87 files and 47 figures. Seven failures, all [T2] accuracy
bars: four in P2 and two in P3 are worst-over-the-sweep measures dominated by
the coarsest grid, where the paired finest-grid checks pass comfortably; P4's
excess-kurtosis monotonicity is a real finding about grid truncation rather
than a defect.
Checks are tiered. T0 is the same arithmetic reached two ways, T1 an algebraic
identity through different code, T2 accuracy against analytic truth, MC a
Monte Carlo bound at 4*se. DiscSummary reads the diary back at the end and
prints one verdict, because the bank prints its results in four formats and
a reader who scans for one of them will report a clean run having not looked
at the other three.
The truth is recomputed inside each subcode, never read from the command's own
otheroutputs - using a command's answer as its own oracle makes every accuracy
number a tautology. Life-cycle blocks get exact age profiles from the cumulant
recursion; P6 to P8 additionally use the frozen-life-cycle identity, where
constant parameters must collapse a life-cycle command onto the stationary one
it extends.
Found B24 through B33 in the toolkit, the last four fixed in 498cdc6d. B33 in
particular needed this bank's shape to find: it is silent unless the process
parameters actually vary with age, so every frozen-parameter identity matched
exactly while it was live.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tests all sorts of things, and included cleaning up some minor aspects and implementing some missing options . As part of this I eliminated the dependence on Matlab Toolboxes (mostly around eliminating use of normcdf) except for multivariate normals . This leaves all the discretization methods much better tested than before, and with better default settings. It also puts me in a position up to add a couple of new discretization methods, hopefully coming soon.
1 Like