Description
Series System Distributions from Dynamic Failure Rate Components.
Description
Compose multiple dynamic failure rate distributions into series system distributions where the system hazard equals the sum of component hazards. Supports hazard, survival, cumulative distribution function, density, sampling, and maximum likelihood estimation fitting via the dfr_dist() class from 'flexhaz'. Series distributions implement the 'dist.structure' protocol so structural queries (phi, min_paths, min_cuts, system_signature, structural importance, reliability, dual) and the importance measures from 'dist.structure' work directly on serieshaz objects. Methods for series system reliability follow Barlow and Proschan (1975, ISBN:0898713692).
README.md
serieshaz
Series System Distributions from Dynamic Failure Rate Components
serieshaz composes multiple dfr_dist objects into a series system distribution. A series system fails when any component fails, so the system hazard is the sum of component hazards:
$$h_{sys}(t) = \sum_{j=1}^{m} h_j(t, \theta_j)$$
The resulting object inherits from dfr_dist, so all existing methods — hazard, survival, CDF, density, sampling, log-likelihood, and MLE fitting — work automatically.
Installation
Install from r-universe:
install.packages("serieshaz", repos = "https://queelius.r-universe.dev")
Quick Start
library(serieshaz)
# Three-component server with different failure modes
server <- dfr_dist_series(list(
dfr_weibull(shape = 2, scale = 500), # disk wear-out
dfr_exponential(0.001), # random memory failure
dfr_gompertz(a = 0.0001, b = 0.02) # PSU degradation
))
# Evaluate system hazard and survival
h <- hazard(server)
S <- surv(server)
h(100) # system hazard at t = 100
#> [1] 0.002538906
S(100) # probability of surviving past t = 100
#> [1] 0.8420252
# Sample system lifetimes
set.seed(42)
samp <- sampler(server)
times <- samp(5)
times
#> [1] 294.9884 302.0998 150.3888 274.2224 236.8369
# Introspect: which component contributes most at t = 200?
for (j in 1:ncomponents(server)) {
hj <- component_hazard(server, j)
cat(sprintf("Component %d hazard at t=200: %.6f\n", j, hj(200)))
}
#> Component 1 hazard at t=200: 0.001600
#> Component 2 hazard at t=200: 0.001000
#> Component 3 hazard at t=200: 0.005460
Key Features
- Composition: Combine any
dfr_distobjects (Weibull, exponential, Gompertz, log-logistic, custom) into series systems - Full interface: All distribution methods (hazard, survival, CDF, density, quantile, sampling) work out of the box
- MLE fitting: Fit series system parameters to observed failure data with
fit() - Introspection:
ncomponents(),component(),param_layout(),component_hazard(),sample_components() - Nesting: Series systems can be nested as components of larger series systems
- Analytical cumulative hazard: When all components provide closed-form cumulative hazard, the series system does too
Ecosystem
serieshaz builds on:
- algebraic.dist — Base distribution generics
- likelihood.model — Statistical inference generics
- flexhaz — Dynamic failure rate distributions
Documentation
vignette("series-overview")— Package overview and quick startvignette("series-math")— Mathematical foundationsvignette("series-fitting")— MLE fitting and inferencevignette("series-advanced")— Advanced composition patterns.