Introduction
crimlab is open-source software for the statistics of courts, corrections, policing, forensics and sociolegal research. It is written for researchers and analysts who need these quantities computed correctly, and who want to know what each one does and does not show.
How it is built
Section titled “How it is built”- One compiled core. Every computation runs in a C++17 core with a plain C interface. The core has no dependencies.
- A binding for each language. R, Python, the command line, Rust, Java and JavaScript call the same core, so a function gives the same checked answer in every language. See the languages.
- Proofs where there are any. Where an identity or a bound has a machine-checked proof in Lean, the function names the theorem. See proofs.
- Measured speed. Timings against other software are on the speed page.
What it takes
Section titled “What it takes”The functions work on summary data, not on raw records: counts by group, outcomes coded 0 or 1 with a group or a decision for each person, allele frequencies and genotypes, likelihood ratios from validation comparisons, networks as lists of edges, point locations of incidents, and risk scores with outcomes and groups.
What it computes
Section titled “What it computes”- Disparities: what visibility changes about who is stopped, what an odds ratio says about risk, and how a disparity per resident splits into contact and force.
- Forensics: how rare a DNA profile is, what a likelihood ratio is worth, kinship, mixtures and database searches.
- Policing: clearance rates, proxies for exposure, misrecorded group membership and regression to the mean at hot spots.
- Corrections: incapacitation, release rules, time in custody and what observational data alone say about a sentence’s effect.
- Networks: who co-offends with whom, and the core and communities of a network.
- Places: where incidents centre, whether they cluster, where the hot spots are and whether nearby places have similar rates.
- Counts, rates and tables: rate ratios with an exposure, standardised rates, observed over expected counts and cross-tabulation.
- Risk tools and predictive policing: the fairness and calibration of a risk tool by group, and audits of where a tool sends attention.
Functions by family lists every function, and the API reference has a page for each.
Licence
Section titled “Licence”Apache License 2.0 with the LLVM exception. The source is on GitHub.
Where to start
Section titled “Where to start”- Install it for your language.
- Read the page for your language.
- Find the function you need in functions by family.