pilotr (Python)¶
Simulate experimental and behavioural data from a portable JSON design specification.
This is the twin of the R package of the same name,
carrying its generative core. The two share the design specification and the random-number
generator, so the same specification and seed produce identical data in either language wherever
the two share a maths library, as on Linux. Elsewhere, a value that passes through exp(), log()
or pow() can differ in its last bits, as Cross-language reproducibility sets
out. Simulation, validation, the analysis model a specification implies, simulation-based power
and the curve solvers are here. Precision/ROPE design analysis, the lme4 reference backend for
mixed-effects power, the brms bridge, the analysis-script emitters, the helpers that build
specifications, and the app launcher are in the R package alone.
Get started Try the no-code app
A design specification names the units, the factors and their contrasts, the fixed effect sizes, any random effects and a response family. From that one file pilotr draws a data set, estimates power and precision by simulation, then emits the analysis code the design implies. The same file drives the R package, the browser-based no-code app and this Python package, so a design built by pointing and clicking can be run unchanged in a script, and a design written in a script can be handed to a collaborator who has installed nothing.
The generative core is pure Python and dependency-free. scipy, statsmodels and pandas are
optional extras, needed only by the power tools. The Get started guide
covers installing pilotr and simulating a first data set.
Where to go next¶
The guides follow the workflow, from choosing a response family to sizing a study and checking that the two languages agree.
- Response families: Gaussian, lognormal, reaction times, accuracy, counts, ordinal, Beta and the ex-Gaussian.
- Worked examples: one ready-to-run design per family.
- Power and design analysis:
power,power_curveandpower_mixed, withsolve_curveandtarget_nfor the sample size a curve implies, andpower_reportfor the sample-size justification. - Cross-language reproducibility: how the same spec gives identical data in R and Python, and where the last bits can differ.
- Specification format: the JSON spec and the cross-language RNG contract.
- API reference: every public function and class.
If pilotr contributes to published work, please cite it. Its citation gives the concept DOI https://doi.org/10.5281/zenodo.21266313, which resolves to the latest release archived on Zenodo.