Catalog PyPI
PACKAGE EXPLORERView in registry

actudist

PyPI

Actuarial probability distributions for P&C loss modeling: severity and frequency families, MLE fitting, layer statistics, goodness-of-fit.

actuarialburrdistributionsfrequencygoodness-of-fitheavy-tailinsurancemleparetoseverity
Versions collected1
Direct dependencies7From release 0.1.0
Last observed20 Oct, 18:42 UTC

README

Version 0.1.0 documentation

PyPI version Python 3.10+ License: MIT

actudist

Python library for P&C loss distributions. Severity and frequency families follow the parameterizations in Klugman, Loss Models. Every severity distribution exposes layer statistics (LEV, excess pure premium, ILF) as methods. MLE accepts right-censored and one- or two-sided truncated samples.

Installation

pip install actudist

From source:

git clone https://github.com/CosmikArt/actudist.git
cd actudist
pip install -e ".[dev]"

Quickstart

import numpy as np
from actudist import DistributionFitter, GoodnessOfFit
from actudist.severity.lognormal import Lognormal

rng = np.random.default_rng(42)
claims = Lognormal(mu=8.0, sigma=1.2).rvs(size=2000, random_state=rng)

fit = Lognormal()
fit.mle_fit(claims)
print(f"mu={fit.mu:.3f}  sigma={fit.sigma:.3f}")
print(f"AIC={fit.aic(claims):.1f}  BIC={fit.bic(claims):.1f}")
print(f"LEV(50000)={fit.limited_expected_value(50_000):.1f}")
print(f"EPP(50000)={fit.excess_pure_premium(50_000):.1f}")

fitter = DistributionFitter(["Lognormal", "Pareto", "Weibull"])
ranking = fitter.fit_and_rank(claims, criterion="aic")
for row in ranking:
    print(f"{row['name']:12s}  aic={row['aic']:.1f}")

gof = GoodnessOfFit(fit, claims)
result = gof.ks_test(n_boot=200, random_state=42)
print(f"KS stat={result['statistic']:.4f}  p={result['p_value']:.3f}")

Modules

  • actudist.severity: 13 continuous distributions (Exponential, Pareto, Lognormal, Weibull, Gamma, Burr XII, Log-Logistic, Paralogistic and its inverse, Inverse Gaussian, Transformed and Inverse Transformed Gamma, Transformed Beta).
  • actudist.frequency: Poisson, Binomial, Geometric, Negative Binomial, ZIP, ZINB.
  • actudist.fitting: registries and DistributionFitter for AIC/BIC ranking.
  • actudist.gof: KS and Anderson-Darling with parametric-bootstrap p-values, chi-squared, PP and QQ plots.
  • actudist.layers: excess pure premium, ILF, finite-layer expected loss.

profile_likelihood_ci lives on the base class; call it on any fitted instance.

References

  • Klugman, S. A., Panjer, H. H., & Willmot, G. E. Loss Models: From Data to Decisions (5th ed.). Wiley.
  • Hogg, R. V. & Klugman, S. A. Loss Distributions. Wiley.
  • Society of Actuaries. Exam STAM / FAM syllabus and study materials.

Contributing

Run pytest before sending a PR.

Author

Isaac López

MIT License. See LICENSE.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.02 May 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

ACCESSIBLE
cosmikart/actudist

Shared repository data · GitHub

License detected in repository
MIT
License branch / ref
main
Last push
2 May 2026
Archived
No
Contributor identities
— · partial collection

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

0count
Gauge · observed snapshots22 Oct 2026
10.50
2026-10-22: 0 · observed 2026-10-22T18:44:41.1689670Z
22 Oct22 Oct

github · 1 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2202026-10-22T18:44:41.1689670Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:42 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:6f68aa265bae6757040e09743d226b9f52d0d39ac8cba3f856f12383d00800af