Overview
The simulation is a discrete event simulation that models criminal recidivism on a per-individual basis. Each individual enters the system, serves a probation term, and may reoffend, be incarcerated, receive treatment, or depart. The simulation tracks community-level statistics and individual trajectories across configurable policy regimes.
Simulation Flow
Event Types
The simulation processes the following discrete events:
| Event | Code | Description |
|---|---|---|
| Arrival | arriv | Individual enters the system |
| Leave | leave | Departure from probation |
| Recidivism | offnd | Reoffending event |
| End of probation | endpr | Probation term expires |
| Return | retrn | Individual returns after a prior departure |
| Incarceration | incar | Sent to prison |
| Admit | admit | Admitted to treatment |
| Revoke | revok | Probation revoked |
Treatment Policies
Treatment policies are defined in simulation_treatment.py and applied periodically to select and enroll qualifying individuals:
treatment_null— no treatment (baseline)treatment_rule_priority— enroll by risk priority (e.g., high-risk first)treatment_rule_random— enroll randomly among qualifying individuals
Qualification criteria control who is eligible (e.g., currently on probation, not yet treated). Two modes are provided:
QUAL_STRING_ANYTIME— eligible at any point during probationQUAL_STRING_ENTRY_ONLY— eligible only upon arrival to probation
Data Fitting
sirakaya.py fits survival models to the 1989 felony cohort data (Sirakaya, 2006) using Cox proportional hazards regression (lifelines.CoxPHFitter) and Gaussian mixture models. The fitted hazard rates parameterize the simulation's recidivism process.
Individual-level covariates include: sex, age, race, marital status, education, prior convictions, drug abuse history, offense type, employment, and community-level variables (poverty rate, crime rate, political leaning, etc.).