Skip to content

Add LoadSharingModel: load-sharing dynamic node (#38) - #64

Merged
derrynknife merged 1 commit into
masterfrom
claude/package-review-recommendations-2lmh5a
Jul 20, 2026
Merged

Add LoadSharingModel: load-sharing dynamic node (#38)#64
derrynknife merged 1 commit into
masterfrom
claude/package-review-recommendations-2lmh5a

Conversation

@derrynknife

Copy link
Copy Markdown
Owner

Summary

Adds LoadSharingModel (#38): a dynamic RBD node for load-sharing / dependent failure, a sibling to StandbyModel. n coupled units share a total load; when one fails the survivors carry more (L / s) and — through their AFT phi(load) response — age faster. The group works while ≥ k of n survive. Because the units are coupled, the group is a single node (it can't be n independent nodes).

Engine — a cumulative-exposure event loop (per Monte-Carlo replicate): draw each unit's baseline exposure-to-failure threshold, advance every survivor's baseline clock at rate phi(L / survivors), drop the first to reach its threshold, repeat until fewer than k survive.

This is the "self-loading" sibling of the condition-based layer: same conditional-survival engine, but the load comes from the group's own survivors rather than from sensors.

  • New repyability/rbd/load_sharing_node.py: sf/ff/mean/random/cs. Identical Exponential-baseline units get an exact hypoexponential closed form (stage rates s·λ·phi(L/s)); otherwise the survival is a Kaplan-Meier fit to simulated lifetimes (is_simulated reports which).
  • Wired into NonRepairableRBD exactly like StandbyModel (simulation node, time-varying, non-stateable, node_mttf), RBD (de)serialisation, and exported from the package.

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

  • Exactness anchor: with no load effect (phi ≡ 1) the stage rates become s·λ and the closed form is exactly the (N-k+1)-th order statistic of N i.i.d. Exponentials — the ordinary k-out-of-n parallel result. A test checks this against the binomial-sum formula, and closed-form vs Monte-Carlo agreement is tested for the load-dependent case.
  • AFT-specific by design: the exposure clock relies on the AFT time-scale property, so units are fitted surpyval AFT models fitted with load as the covariate. This is the same phi/exposure machinery kept internal here — it does not touch the public RegressionNode/NodeState API.
  • Distribution fitting stays in surpyval; RePyability consumes the fitted models.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS


Generated by Claude Code

A sibling to StandbyModel where n coupled units share a total load and the
survivors carry more (and so age faster) as siblings fail -- dependent
failure. The group works while at least k of n units survive.

Each unit is a fitted AFT model; a cumulative-exposure event loop advances
every survivor's baseline clock at rate phi(L / survivors), dropping the first
unit to reach its baseline exposure-to-failure threshold. This is the
"self-loading" sibling of the condition-based layer: same engine, but the load
comes from the group's own survivors (L / s) rather than from sensors.

- New LoadSharingModel (repyability/rbd/load_sharing_node.py): sf/ff/mean/
  random/cs; identical Exponential-baseline units get an exact hypoexponential
  closed form, otherwise a Kaplan-Meier fit to simulated lifetimes
  (is_simulated reports which). phi == 1 reproduces the exact k-out-of-n
  parallel result.
- Wired into NonRepairableRBD as a simulation node (like StandbyModel):
  _SIMULATION_NODE_TYPES, time-varying detection, non-stateable, node_mttf;
  RBD (de)serialisation; exported from the package.
- Tests anchor the phi == 1 closed form against the exact k-of-n order
  statistic, check closed-form/Monte-Carlo agreement, dependent-failure
  monotonicity, RBD integration and serialisation. Docs (guide + api) 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 57a03e9 into master Jul 20, 2026
8 checks passed
@derrynknife derrynknife mentioned this pull request Jul 20, 2026
3 tasks
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