Skills
A skill is a package of structured files that teaches an AI coding agent how to work with a specific tool or framework. The skill below was generated by Great Docs from this project’s documentation. Install it in your agent and it will be able to run commands, edit configuration, write content, and troubleshoot problems without step-by-step guidance from you.
Any agent — install with npx:
npx skills add https://ekthesage.github.io/ibnr/Codex / OpenCode
Tell the agent:
Fetch the skill file at https://ekthesage.github.io/ibnr/skill.md and follow the instructions.Manual — download the skill file:
curl -O https://ekthesage.github.io/ibnr/skill.mdOr browse the SKILL.md file.
SKILL.md
--- name: ibnr description: > Gallery-centric probabilistic loss reserving: Bayesian MCMC and neural network methods with mandatory evaluation, over a long-format triangle data layer. Use when writing Python code that uses the ibnr package. license: MPL-2.0 compatibility: Requires Python >=3.11,<3.13. --- # ibnr Gallery-centric probabilistic loss reserving: Bayesian MCMC and neural network methods with mandatory evaluation, over a long-format triangle data layer. ## Installation ```bash pip install ibnr ``` ## API overview ### Reserving methods The front door for the traditional methods: one function per method, named after it, on one triangle's cells given as any Arrow-readable table (a polars DataFrame or a pyarrow Table). Import with `from ibnr import methods`. Results are pyarrow Tables, and ReserveResult.to_polars() gives any of them as a polars DataFrame. Input a method will not answer is refused with Refusal, a ValueError with a reason code. Coming from chainladder-python, see [the lookup table](https://github.com/EKtheSage/ibnr/blob/main/docs/coming-from-chainladder.md). - `methods.chain_ladder` - `methods.mack` - `methods.bornhuetter_ferguson` - `methods.benktander` - `methods.cape_cod` - `methods.tweedie_glm` - `methods.ml_development` - `methods.one_year_cdr` - `methods.odp_bootstrap` - `methods.ReserveResult` - `methods.OneYearCDRResult` - `methods.BootstrapResult` - `methods.Refusal` ### Triangle The long-format triangle data layer - a tidy table of origin_period / dev_lag / eval_date cells over an ibis expression (duckdb or polars backend), carrying grain, cumulative/incremental, and units metadata. - `Triangle`: A reserving triangle over an ibis table expression - `TriangleMeta`: Triangle-level metadata. Carried through every transformation ### Triangle transforms & interop Cumulative/incremental conversion, grain changes, as_of() backtest slicing, and lossless round-trips with chainladder-python and bermuda. - `Triangle.from_long` - `Triangle.from_chainladder` - `Triangle.to_chainladder` - `Triangle.from_bermuda` - `Triangle.to_bermuda` - `Triangle.to_cumulative` - `Triangle.to_incremental` - `Triangle.with_dev_grain` - `Triangle.with_origin_grain` - `Triangle.as_of` - `Triangle.latest_diagonal` - `Triangle.filter` - `Triangle.select_fields` - `Triangle.to_wide` - `Triangle.to_pandas` - `Triangle.to_polars` - `Triangle.execute` - `Triangle.count` - `Triangle.with_expr` - `Triangle.validate` ### Gallery Discover, retrieve, and fit reserving models through the GalleryEntry contract. Every entry - Bayesian, neural, or statistical - produces a PredictiveDistribution. - `gallery.list` - `gallery.get` - `gallery.fit` - `gallery.GalleryEntry` ### Held-out evaluation The four steps between a fitted entry and a leaderboard row: which cells a fit at as_of is scored on, one model's arrays at those cells, the cross-model intersection, and the board. - `gallery.next_diagonal` - `gallery.CohortForecast` - `gallery.Absence` - `gallery.align_panel` - `gallery.leaderboard` - `gallery.reserve_rows` - `gallery.SCORE_DIRECTION` - `gallery.stack` ### Chain ladder & reserve risk The distribution-free chain ladder (Mack 1993) and its run-off MSEP, plus the one-year claims development result - the Solvency II reserve-risk view. cdr_methods() is the option surface: which model generates next year's diagonal, how the reserve is re-estimated once it exists, and what each route has actually been validated against. - `kernels.MackFit` - `kernels.fit_mack` - `kernels.fit_mack_grid` - `kernels.cohort_grid_frame` - `kernels.simulate_ultimates` - `kernels.cdr_methods` - `kernels.get_cdr_method` - `kernels.one_year_cdr` - `kernels.simulate_one_year_cdr` - `kernels.rereserve` - `kernels.cdr_risk_measures` - `kernels.CDRResult` - `kernels.MackDiagonal` - `kernels.ODPBootstrapDiagonal` - `gallery.GalleryDiagonal` ### Tweedie GLM development The kernel under methods.tweedie_glm: a Tweedie GLM fitted to a cumulative grid's increments by iteratively reweighted least squares, numpy only, with no penalty. - `kernels.fit_tweedie_grid` - `kernels.TweedieSpec` - `kernels.TweedieFit` ### Machine-learning development The kernel under methods.ml_development: a random forest or gradient boosting (scikit-learn, from the ml extra) fitted to a cumulative grid's cells over chainladder-python's DevelopmentML design, each origin projected by its own fitted pattern. - `kernels.fit_ml_development_grid` - `kernels.MLDevelopmentSpec` - `kernels.MLDevelopmentFit` ### Conventional point candidates Chain ladder, Bornhuetter-Ferguson and Gluck's generalized Cape Cod as fixed settings that can be refitted at successive information dates. A replay measures each candidate's realized actual-versus-expected and the observed change in its fitted ultimate over one development period; selection picks a candidate on those historical outcomes alone, and the evaluation scores the frozen forecast against later terminal observations. - `kernels.fit_conventional` - `kernels.fit_conventional_grid` - `kernels.conventional_grid` - `kernels.ConventionalCandidate` - `kernels.ConventionalFit` - `kernels.replay_conventional` - `kernels.ConventionalReplay` - `kernels.score_replay` - `kernels.select_conventional` - `kernels.ConventionalSelection` - `kernels.evaluate_conventional` - `kernels.ConventionalEvaluation` ### Tails Development after the last observed age: a constant tail, or an exponential, inverse power or Weibull curve fitted to the link factors. A TailSpec goes on a ConventionalCandidate or into fit_mack_grid, where tail_variance gives the tail step's sigma and standard error for Mack's standard errors. apply_tail takes one row of factors per simulation too. - `kernels.TailSpec` - `kernels.apply_tail` - `kernels.tail_variance` ### Evaluation kernels The unifying predictive-distribution output type, the cross-backend posterior-parity tooling, and the point-error metrics - which take the level errors are summed within as an argument, because summing before the absolute value is where one line's overestimate cancels another's underestimate. - `kernels.PredictiveDistribution` - `kernels.ParityReport` - `kernels.compare_posteriors` - `kernels.point_metrics` - `kernels.level_errors` - `kernels.shrink_toward` - `kernels.point_summary` ### Residual calibration Historical uncertainty for a point forecaster: apply it at earlier cutoffs, pool the standardised errors by unit size, and resample them around the final point. - `kernels.rolling_residuals` - `kernels.calibrate` - `kernels.Calibration` - `kernels.calibrated_draws` - `kernels.leave_one_out_coverage` ### Wire format The single place an ibnr result becomes bytes - one Arrow IPC stream per artifact, uncompressed by default, plus a one-way JSON summary for callers that cannot take the draws. - `kernels.to_arrow` - `kernels.from_arrow` - `kernels.peek_kind` - `kernels.to_summary` - `kernels.CODEC_VERSION` - `kernels.CONTENT_TYPE_ARROW` - `kernels.CONTENT_TYPE_JSON` - `kernels.DEFAULT_QUANTILES` ### Retrospective harness Parallel company x line backtesting with staged sampler escalation - the compute seam behind the study scripts. - `kernels.harness.run_retro` - `kernels.harness.run_task` - `kernels.harness.RetroTask` - `kernels.harness.SamplerSettings` - `kernels.harness.ConvergenceGates` - `kernels.harness.precompile` - `kernels.harness.default_max_workers` ## Resources - [Full documentation](https://ekthesage.github.io/ibnr/) - [llms.txt](llms.txt) — Indexed API reference for LLMs - [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs - [Source code](https://github.com/EKtheSage/ibnr)