Add common-cause failures: beta-factor model (#44) - #65
Merged
derrynknife merged 2 commits intoJul 21, 2026
Conversation
Redundant components often fail from a shared root cause, so their failures are correlated; the exact engine assumes independence and over-estimates redundant systems. Add the beta-factor CCF model: a fraction beta of a symmetric group's failures come from a cause shared across the group (failing every member at once), the rest are independent. NonRepairableRBD gains a `ccf_groups` argument taking CCFGroup(members, BetaFactor(beta)). System reliability is computed *exactly* by conditioning on each group's shared-cause event (fires -> whole group down; else each member fails only independently) and summing the 2**groups branches, each an ordinary independent system-probability evaluation. So beta=0 reproduces the independent result exactly and beta=1 collapses a group to a single component. - New repyability/rbd/ccf.py: BetaFactor and CCFGroup, with validation. - NonRepairableRBD: ccf_groups validated (members exist, non-repeated, not in/out, disjoint, symmetric); sf/ff route through the conditioning engine; RBD serialisation captures the groups. - The probability-dependent importance/sensitivity and condition-based methods raise a clear NotImplementedError on a CCF RBD (CCF is honoured by sf/ff); structural_importance is probability-free and stays available. - Tests anchor beta=0 == independent and the exact 2-parallel conditioning against the textbook beta*Q + ((1-beta)Q)^2, plus multiple groups, time-varying, serialisation and validation. Docs (guide + api) and CHANGELOG updated. Alpha-factor / MGL (partial common-cause) are a planned extension. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
Extend the CCF support with the Multiple Greek Letter model alongside beta-factor. MGL captures partial common causes (a cause failing some but not all of a group) via a cascade of conditional probabilities beta, gamma, delta, ...; the number of letters fixes the group size (m-1 letters for m members). MGL(beta) on two members is exactly BetaFactor(beta). - New MGL model (repyability/rbd/ccf.py) with the standard MGL basic-event probabilities Q_k for a specific k-of-m subset. Both CCF models now share a decompose(members, Q) -> (independent failure, mutually-exclusive shocks) interface, and NonRepairableRBD's conditioning engine sums over each group's shock-outcome partition (generalising the beta-factor fires/not branches), reusing the ordinary independent engine per branch. - Serialisation and package export extended; group-size validation for MGL. - Tests: MGL(beta) == BetaFactor(beta) on two members; a 1-of-3 triple matches the textbook leading-order MGL result; gamma=1 collapses to all-or-nothing; serialisation round-trip; validation. Docs and CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds common-cause failures (CCF) to
NonRepairableRBDvia the beta-factor model (#44). Redundant components often fail from a shared root cause, so their failures are correlated; the exact engine assumes independence and over-estimates redundant systems. Beta-factor splits a symmetric group's failures: a fractionbetacome from a cause shared across the group (failing every member at once), the rest are independent.It reuses the exact engine — no rewrite. System reliability is computed by conditioning on each group's shared-cause event (fires → the whole group is down; doesn't → each member fails only independently) and summing the
2**groupsbranches, each an ordinary independentsystem_probabilityevaluation. So:beta = 0reproduces the independent result exactly,beta = 1collapses a redundant group to a single component,beta*Q + ((1-beta)Q)^2(to higher order — the conditioning is exact).Type of change
Checklist
black,isort,flake8, andmypypasscoverage run -m pytestpasses and stays above the coverage gateCHANGELOG.mdupdated under[Unreleased]Notes for reviewers
sf()/ff()(and quantities derived from them). The probability-dependent importance/sensitivity measures and the condition-based (age) methods raise a clearNotImplementedErroron a CCF RBD rather than silently returning independent results;structural_importance, being probability-free, is unaffected and still works. This keeps the first pass honest.rbd.pyis unchanged; all wiring is inNonRepairableRBD+ a smallccf.py.🤖 Generated with Claude Code
https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
Generated by Claude Code