
A mortality law is a small parametric function that describes how a
population dies out with age: high mortality in infancy, a hump at young
adult ages, and an exponential climb from middle age onward.
MortalityLaws fits these laws to observed deaths, exposures
and rates, turns any fit or any observed schedule into a full life
table, and pulls the underlying data straight from the Human Mortality
Database and its national siblings.
Mortality data rarely arrive in the shape the question needs. A statistical office publishes deaths and exposures by age and year. The resulting curve is jagged where deaths are few, thin at the oldest ages, and often closed at 85+ or 90+ with a single wide interval. What you usually want is the opposite: a smooth description of the age pattern of death that you can compare across populations and years, integrate into a life table, or carry past the last observed age.
Parametric mortality laws are the classical answer, and there are many of them. Each is a small formula with a handful of parameters, each is good at some part of the age range and quietly wrong somewhere else. Doing this by hand means a spreadsheet of starting values, one script per formula, and no two fits graduated quite the same way. (Picking a law by eye is a time-honoured tradition, and reproducible only by accident.)
MortalityLaws removes the assembly line. The package
ships 38 laws, 8 fitting objectives (two likelihoods and six losses) and
6 accepted life-table inputs. That is 38 x 8 x 6 = 1,824 combinations of
law, loss and input, and every one of them is a single function
call.
| capability | how |
|---|---|
| Fit a law to observed data | MortalityLaw(), from deaths and exposures,
mx, or qx |
| Supply your own law | custom.law, any function of x and
par you can write |
| Judge whether a fit deserves trust | plot.MortalityLaw(): observed versus fitted, plus four
residual diagnostics |
| Build full and abridged life tables | LifeTable(): 6 input types, 4 ax methods,
and close / omega for the tail |
| Convert between mortality indicators | convertFx() across mx, qx,
dx, lx, Lx, Tx,
ex; LawTable() turns a law and its parameters
into a whole table |
| Download demographic data | ReadHMD(), ReadJMD(),
ReadCHMD(), ReadAHMD(): 50 HMD countries, 6
interval formats from 1x1 to 5x10 |
| Look things up | availableLaws(), availableLF(),
availableHMD(), dispersion() |
Install the stable release from CRAN:
install.packages("MortalityLaws")The development version comes from GitHub. pak is the
recommended installer, and like any install from source it needs a
working development toolchain:
# install.packages("pak")
pak::pak("mpascariu/MortalityLaws")Check that everything works:
library(MortalityLaws)
availableLaws() # the catalogue: 38 laws with formulas and lifespan typesFor the CRAN version, simply re-run
install.packages("MortalityLaws") every so often. For the
development version, run
pak::pak("mpascariu/MortalityLaws") again to pull the
latest commits.
vignette("Intro", package = "MortalityLaws")To cite MortalityLaws in publications use:
Pascariu M (2026). MortalityLaws: Parametric Mortality Models, Life Tables and HMD. R package version 3.0.0, https://github.com/mpascariu/MortalityLaws.
A BibTeX entry for LaTeX users is:
@Manual{,
title = {MortalityLaws: Parametric Mortality Models, Life Tables and HMD},
author = {Marius D. Pascariu},
year = {2026},
note = {R package version 3.0.0},
url = {https://github.com/mpascariu/MortalityLaws},
}Issues and pull requests are welcome. If MortalityLaws
misbehaves, please open an issue with a minimal reproducible example at
https://github.com/mpascariu/MortalityLaws/issues, and
see CONTRIBUTING.md.
This project is released with a Contributor
Code of Conduct.