Returns the number of components \(m\) in a series system, corresponding to the number of terms in \(h_{sys}(t) = \sum_{j=1}^{m} h_j(t)\).
Arguments
- x
A system object (e.g.,
dfr_dist_series).- ...
Additional arguments passed to methods.
Details
For a dfr_dist_series object created from a list of
m components, this simply returns m. This is useful for
programmatically iterating over components, e.g., for plotting hazard
decompositions or computing failure attribution.
See also
component to extract individual components,
dfr_dist_series for the constructor
Other system introspection:
component(),
component_hazard(),
param_layout(),
sample_components()
Examples
# \donttest{
library(flexhaz)
sys <- dfr_dist_series(list(
dfr_exponential(0.1),
dfr_weibull(shape = 2, scale = 100),
dfr_gompertz(a = 0.01, b = 0.05)
))
ncomponents(sys) # 3
#> [1] 3
# }