kernels.simulate_one_year_cdr()
Actuary in the box: the one-year CDR distribution by re-reserving.
Usage
kernels.simulate_one_year_cdr(
fit,
*,
n_draws=None,
seed=None,
generator=None,
process=None,
parameter_risk=None
)One draw is one possible next year - DiagonalGenerator.draw() says what emerged, rereserve() re-runs the volume-weighted chain ladder on the extended triangle and differences the ultimates. Returns per-origin CDR draws plus a total column derived from the same draws, so the diversification between accident years is in the samples; a positive draw is a reserve release.
generator picks the first axis: a method name from cdr_methods(), or a configured instance:
simulate_one_year_cdr(fit) # Mack, defaults
simulate_one_year_cdr(fit, generator="odp_bootstrap")
simulate_one_year_cdr(fit, generator=ODPBootstrapDiagonal(process="gamma"))n_draws=None means “this generator’s own count”, which is DEFAULT_N_DRAWS for the two simulating generators and the fitted posterior’s own size for ibnr.gallery.GalleryDiagonal - see DiagonalGenerator.resolve_n_draws(). It replaced a literal 20_000 default in 0.5.1 and changes no number: both simulating generators resolve None to exactly that.
process and parameter_risk are MackDiagonal’s knobs, kept on this signature because they are the published 0.5.0 API - None means “that generator’s default”, so the defaults and every explicit call are unchanged. They cannot be combined with generator=; pass them to the generator instead, and see _resolve_generator() for why.
seed is anything np.random.default_rng accepts. The mack gallery entry hands a per-cohort SeedSequence through here; a plain integer keeps the byte-exact meaning it has always had.
generator="merz_wuthrich" is refused by name: the closed form is a linearization of the chain-ladder factor update around Mack’s moments, not a way of generating a diagonal, and one_year_cdr() is where it lives. generator="gallery" is refused too, for the opposite reason - it IS a generator, but it wraps a fitted entry that no string can carry.