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.0
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.0.tar.gz | 1.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pirao-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.3 MB
Release files / pirao-0.1.0.tar.gz
| Download URL | pirao-0.1.0.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a0d074ed275e83c5e29c625c1af380e8cca4547bc3ce1091b47ad20730bba79
|
|
BLAKE2b-256 checksum How to use checksums |
dad9fc44570444279fa9998648ef994e8160e2fbf5b837dbc42a25a86a50d94a
|
| 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.0-py3-none-any.whl
| Download URL | pirao-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b333cac7040e2f17706ae8b63f36d5184e69fcb0c1849c1e82d1a457a12d1c42
|
|
BLAKE2b-256 checksum How to use checksums |
876e9912fff6df0d0b8b2066794d2a35ff082ef42a743f3a49ee9a1a634b2a0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|