exposure: Exposure Analysis for Repairable Systems.

View source: R/exposure.R

exposureR Documentation

Exposure Analysis for Repairable Systems.

Description

Computes exposure (total operating time at risk) across one or more repairable systems as a function of time. Exposure is defined as the total accumulated observation time summed across all systems still under observation. The function also computes the number of systems at risk and the event rate (events per unit exposure) at each event time.

Usage

exposure(id = NULL, time = NULL, event = NULL, data = NULL)

Arguments

id

A vector of system/unit identifiers. Each unique value represents a distinct system.

time

A numeric vector of event or censoring times. Must be positive and finite.

event

An optional numeric vector of event indicators: 1 for an event, 0 for censoring (end of observation). If NULL (default), all observations are treated as events, and the maximum time per system is treated as the end of observation.

data

An optional data frame containing columns named id, time, and optionally event.

Details

Exposure is the total amount of operating time during which events can occur. For a fleet of k systems observed up to times T_1, T_2, \ldots, T_k, the total exposure is E = \sum_{i=1}^{k} T_i.

The cumulative exposure at time t is E(t) = \sum_{i=1}^{k} \min(t, T_i), i.e., each system contributes time up to the lesser of t or its observation end.

The event rate at time t is the cumulative number of events divided by the cumulative exposure: r(t) = N(t) / E(t).

Value

An object of class exposure containing:

time

Sorted unique event times (excluding censoring-only times).

n_at_risk

Number of systems under observation at each event time.

cum_exposure

Cumulative total exposure (system-time) up to each event time.

cum_events

Cumulative number of events up to each event time.

event_rate

Cumulative event rate (cum_events / cum_exposure) at each event time.

total_exposure

Total exposure across all systems and the full observation period.

total_events

Total number of events.

n_systems

Number of distinct systems.

end_times

Named numeric vector of end-of-observation times per system. Can be passed directly to mcf(end_time = ...) to ensure the MCF properly accounts for system exposure.

See Also

Other Repairable Systems Analysis: mcf(), nhpp(), overlay_nhpp(), plot.exposure(), plot.mcf(), plot.nhpp(), plot.nhpp_predict(), predict_nhpp(), print.exposure(), print.mcf(), print.nhpp(), print.nhpp_predict()

Examples

id   <- c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3)
time <- c(100, 350, 500, 80, 300, 600, 150, 250, 400, 700)
result <- exposure(id, time)
print(result)
plot(result)

# With censoring
id    <- c(1, 1, 1, 2, 2, 2, 3, 3, 3)
time  <- c(100, 350, 500, 80, 300, 400, 150, 250, 700)
event <- c(  1,   1,   0,  1,   1,   0,   1,   1,   1)
result2 <- exposure(id, time, event)
print(result2)

ReliaGrowR documentation built on May 22, 2026, 5:07 p.m.