Methods for Observational Inference and Robust Analysis of Interventions in Scientific Experimentation. Multi-domain scientific computing toolkit hosting the MRM framework for Canadian carceral, police, and oversight data, with general-purpose causal inference, signal processing, cryptography, spatial statistics, statistical physics, and psychometrics modules.
Project description
MOIRAIS
Methods for Observational Inference and Robust Analysis of Interventions in Scientific Experimentation
A multi-domain scientific computing toolkit (Python and R) for observational inference, with sociolegal, signal-processing, cryptographic, spatial-statistics, statistical-physics, and psychometrics modules. Hosts the MRM framework as a primary application for Canadian carceral, police, and oversight data analysis.
Installation
Python (PyPI)
pip install moirais
R (CRAN)
install.packages("moirais")
R (r-universe; nightly binary builds)
install.packages(
"moirais",
repos = c(
hadesllm = "https://hadesllm.r-universe.dev",
CRAN = "https://cloud.r-project.org"
)
)
Quick start
import moirais
# Load a built-in dataset
df = moirais.load_dataset("otis-2025")
# Run an MRM module on OTIS data
from moirais.otis_all_analyze import analyze_a01_mrm
result = analyze_a01_mrm(df)
print(result)
Documentation
Full documentation is at hadesllm.github.io/moirais.
Citation
If you use MOIRAIS in your research, please cite the package paper, the MRM framework paper, and (where applicable to your work) the Hawkes-process methodology paper:
Ruhela, V. S. (2026). MOIRAIS: A Multi-Domain Scientific Computing
Toolkit for Observational Inference, with Sociolegal, Signal-Processing,
Cryptographic, and Spatial-Statistics Modules. Zenodo.
https://doi.org/10.5281/zenodo.20096350
Ruhela, V. S. (2026). The MRM Framework: A Multi-Source Statistical
Foundation for Canadian Carceral, Police, and Oversight Data, Implemented
as MRM Modules in MOIRAIS. Zenodo.
https://doi.org/10.5281/zenodo.20096075
Ruhela, V. S. (2026). Criminological Hawkes Process via MOIRAIS:
Markovian and Non-Markovian Self-Exciting Point Processes for Toronto
Crime. Zenodo.
https://doi.org/10.5281/zenodo.20102198
See CITATION.cff for machine-readable citation metadata.
Acknowledgments
AI assistance
MOIRAIS was developed with substantial assistance from frontier AI assistants. The author retains full responsibility for the code, the methods, and the scientific claims; AI assistance accelerated implementation but does not change the attribution of the work.
-
Claude — Anthropic. Anthropic's Claude family (Opus, Sonnet, and Haiku across the 4.x generation) was used extensively throughout development for code generation, refactoring, documentation, code review, and design discussions. Use was supported by Anthropic research-credit programs.
-
Gemini and Vertex AI — Google. Google's Gemini 2.5 models (Pro and Flash) on the Vertex AI platform were used extensively for additional code generation, cross-checking Claude-generated code, multi-modal data analysis, and prototype evaluation. Use was supported by Google research-credit programs.
Funding and infrastructure
-
Anthropic — Claude API research credits.
-
Google — Gemini / Vertex AI research credits.
-
The author thanks Glenn McNamara — ~30 years as the statistician at Ontario Provincial Police headquarters, preceded by tenure at Statistics Canada, with a Mathematics and Linguistics background from the University of Toronto — for weekly methodological mentorship over the past six months. He brings distribution theory, applied-statistics intuition for administrative data, and the judgment that grounds much of this framework. Glenn is the M in MRM (McNamara-Ruhela-Medina) (catalyst).
-
The author thanks Prof. Angela Zorro Medina, Centre for Criminology and Sociolegal Studies, University of Toronto, for expert review of the framework and for the methodological lineage established by her work on anti-gang legislation (Zorro Medina, 2023, The Effect of Anti-Gang Laws on Crime and Social Control) — staggered two-way-fixed-effects identification, formal leads-and-lags Granger-causality diagnostics for parallel trends, multi-source data-integration over five jurisdictional sources, deterrence / routine-activities / certainty mechanism categorisation, and the inequality-effects-of-criminal-law framing — all of which directly shape MRM's empirical-statistical spine. Prof. Medina is the M in MRM (reviewer).
Data acknowledgments
Several MRM analyses use Statistics Canada and Health Canada Public
Use Microdata Files (PUMFs) — including the Canadian Cannabis
Survey (CCS), the Canadian Student Alcohol and Drugs Survey
(CSADS), the Canadian Substance Use Survey (CSUS), the
Canadian Alcohol and Drugs Survey (CADS, 2019;
doi.org/10.25318/132500052021001-eng),
and the Canadian Postsecondary Education Alcohol and Drug Use
Survey (CPADS) — along with Public Health Agency of Canada (PHAC)
and Canadian Institute for Health Information (CIHI) aggregates.
Although the analyses use Statistics Canada and Health Canada data,
the analyses, interpretations, and conclusions are those of the
author and do not represent the views of Statistics Canada or
Health Canada. Ontario open data (OTIS, A01-RCDD release; via
data.ontario.ca) and Toronto Police Service open data are used
under the same standard disclaimer.
License
MOIRAIS is released under the GNU General Public License v2 (GPL-2.0-only); see LICENSE. The licensing matrix for individual components is documented in LICENSING.md.
Reporting issues / security
- General issues: GitHub Issues
- Security vulnerabilities: see
SECURITY.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moirais-0.1.0.post3.tar.gz.
File metadata
- Download URL: moirais-0.1.0.post3.tar.gz
- Upload date:
- Size: 7.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52572893950993639456b402832c2eec9473d28c855c1e3ce876e76b17da301e
|
|
| MD5 |
9339620c21ce923f9bf63e93cb06bd16
|
|
| BLAKE2b-256 |
d31bdbd2c4f7e31f25bfd90423e000eb7b5973f32972135c6192cbea6466d7e2
|
Provenance
The following attestation bundles were made for moirais-0.1.0.post3.tar.gz:
Publisher:
pypi-publish.yml on hadesllm/moirais
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moirais-0.1.0.post3.tar.gz -
Subject digest:
52572893950993639456b402832c2eec9473d28c855c1e3ce876e76b17da301e - Sigstore transparency entry: 1495076865
- Sigstore integration time:
-
Permalink:
hadesllm/moirais@474e3e6d5c320289f533a07975a033d5973e5ffd -
Branch / Tag:
refs/tags/v0.1.0.post3 - Owner: https://github.com/hadesllm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@474e3e6d5c320289f533a07975a033d5973e5ffd -
Trigger Event:
push
-
Statement type:
File details
Details for the file moirais-0.1.0.post3-py3-none-any.whl.
File metadata
- Download URL: moirais-0.1.0.post3-py3-none-any.whl
- Upload date:
- Size: 37.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e9c702ab4322a7e78806b504fbbac8da9e6f18bb465928dd9c0b79e9c998710
|
|
| MD5 |
cc159ab3eb6f71b8aba42042a332d076
|
|
| BLAKE2b-256 |
b644464cd9dd10847568986b99bc0f304378028f0bf712a8cffe29ca251e3ad4
|
Provenance
The following attestation bundles were made for moirais-0.1.0.post3-py3-none-any.whl:
Publisher:
pypi-publish.yml on hadesllm/moirais
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moirais-0.1.0.post3-py3-none-any.whl -
Subject digest:
0e9c702ab4322a7e78806b504fbbac8da9e6f18bb465928dd9c0b79e9c998710 - Sigstore transparency entry: 1495077000
- Sigstore integration time:
-
Permalink:
hadesllm/moirais@474e3e6d5c320289f533a07975a033d5973e5ffd -
Branch / Tag:
refs/tags/v0.1.0.post3 - Owner: https://github.com/hadesllm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@474e3e6d5c320289f533a07975a033d5973e5ffd -
Trigger Event:
push
-
Statement type: