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

Simulation Flow

Event Types

The simulation processes the following discrete events:

EventCodeDescription
ArrivalarrivIndividual enters the system
LeaveleaveDeparture from probation
RecidivismoffndReoffending event
End of probationendprProbation term expires
ReturnretrnIndividual returns after a prior departure
IncarcerationincarSent to prison
AdmitadmitAdmitted to treatment
RevokerevokProbation 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 probation
  • QUAL_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.).