pirão
Probabilistic Inference for Reliability Analysis from Observed data: Bayesian reliability estimation with Stan, with a local graphical interface. A sibling of farofa (simulation of repairable systems) and faultree (exact fault-tree analysis).
Pick a likelihood and, separately, a prior for each parameter; supply bounds and data. pirão writes the Stan program, compiles and caches it, samples it, and returns reliability at your mission times with 90% intervals, the reliability curve against the data's own Kaplan–Meier steps, and each parameter's posterior over the prior that was actually in force.
pip install pirao
pirao install-stan # once: compiles CmdStan (a few minutes; needs a C++ compiler)
pirao gui # opens the interface at http://localhost:8765
What it covers
- Likelihoods: exponential, Weibull, lognormal, gamma (time to failure, with right censoring); per-demand Bernoulli and binomial (demands).
- Priors: lognormal, normal, Student t, gamma, inverse gamma, exponential, Weibull, beta, half-normal, half-Cauchy, uniform, flat and Jeffreys, with any bounds. The interface shows the prior after the bounds and warns when they discard much of it.
- Relevance weights per row, for data from similar but not identical equipment (a fractional pseudo-posterior, labelled as such).
- Ready-made examples on public data (Proschan 1963 air conditioning; Lieblein and Zelen 1956 ball bearings) and on clearly illustrative numbers.
- Interface in Portuguese and English.
- Reproducible runs: a
.zipwith the specification, data, seed, Stan program and toolchain versions.
From the shell or Python
pirao examples # list the examples
pirao example relay-binomial --out relay # spec.json, data.csv, sampler.json
pirao run relay/spec.json --data relay/data.csv --sampler relay/sampler.json --out relay/run
from pirao.core.examples import get_example
from pirao.core.results import summarize
from pirao.core.sample import run
from pirao.core.spec import ModelSpec, ParamSpec, PriorSpec
# 23 ball bearings, millions of revolutions to fatigue (Lieblein and Zelen 1956);
# rows are {"time": ..., "failure": 1 or 0}, one per unit.
rows = get_example("bearings-weibull")["rows"]
spec = ModelSpec(
likelihood="weibull",
mission_times=[25, 50],
time_unit="Mrev",
params={
"shape": ParamSpec(lower=0.0, prior=PriorSpec(family="half_normal", hyper={"sigma": 2})),
"scale": ParamSpec(lower=0.0, prior=PriorSpec(family="gamma", hyper={"shape": 2, "rate": 0.02})),
},
)
print(summarize(run(spec, rows)).table[["mean", "q05", "q95"]])
More
The repository has the full README (data format, what the results mean, statistical caveats), the design notes, and a script that carries the posterior draws into farofa and faultree.
BSD 3-Clause licence. CmdStan (BSD 3-Clause) is downloaded by pirao install-stan,
not redistributed.
Metadata
Release files for pirao 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pirao-0.1.1.tar.gz | 1.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pirao-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.3 MB
Release files / pirao-0.1.1.tar.gz
| Download URL | pirao-0.1.1.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a22787c6eea9eedd85a8707bd85030d802eb56ecc1669d6f7f600cceb99becbf
|
|
BLAKE2b-256 checksum How to use checksums |
6ff4bbc18d72847b4ea6de46bb3136fe2f6ecb00baec9a318d7547a81efa1f83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / pirao-0.1.1-py3-none-any.whl
| Download URL | pirao-0.1.1-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7feb803b38d382433cb797193eef6ca8990b174881d4d7eaff7e891ea631bcdd
|
|
BLAKE2b-256 checksum How to use checksums |
95360225f7560c8110e7925a45b5e966e6567b5b9bc2a7db57f8d93f1d87b7d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|