Skip to content

Add common-cause failures: beta-factor model (#44) - #65

Merged
derrynknife merged 2 commits into
masterfrom
claude/package-review-recommendations-2lmh5a
Jul 21, 2026
Merged

Add common-cause failures: beta-factor model (#44)#65
derrynknife merged 2 commits into
masterfrom
claude/package-review-recommendations-2lmh5a

Conversation

@derrynknife

Copy link
Copy Markdown
Owner

Summary

Adds common-cause failures (CCF) to NonRepairableRBD via 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 fraction beta come from a cause shared across the group (failing every member at once), the rest are independent.

NonRepairableRBD(edges, nodes, ccf_groups=[CCFGroup(["p1", "p2"], BetaFactor(0.1))])

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**groups branches, each an ordinary independent system_probability evaluation. So:

  • beta = 0 reproduces the independent result exactly,
  • beta = 1 collapses a redundant group to a single component,
  • and the 2-parallel case matches the textbook beta*Q + ((1-beta)Q)^2 (to higher order — the conditioning is exact).

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / tooling
  • Breaking change

Checklist

  • Tests added/updated (asserting against a reference value where possible)
  • black, isort, flake8, and mypy pass
  • coverage run -m pytest passes and stays above the coverage gate
  • CHANGELOG.md updated under [Unreleased]
  • Any Monte-Carlo tests are seeded (deterministic)

Notes for reviewers

  • Scope of this pass: CCF is honoured by sf() / ff() (and quantities derived from them). The probability-dependent importance/sensitivity measures and the condition-based (age) methods raise a clear NotImplementedError on 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.
  • Symmetric groups only (members carry identical component models — the standard CCF assumption), validated at construction; groups must be disjoint and members must be real, non-repeated component nodes.
  • Alpha-factor and Multiple Greek Letter (partial common-cause — a cause fails some but not all of a group) build on the same conditioning machinery and are a planned fast-follow.
  • Base rbd.py is unchanged; all wiring is in NonRepairableRBD + a small ccf.py.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS


Generated by Claude Code

claude added 2 commits July 21, 2026 01:46
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
@derrynknife
derrynknife merged commit 3d8b42e into master Jul 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants