This function performs reliability growth analysis using the Crow-AMSAA model by
Crow (1975) (AMSAATR138) or piecewise
NHPP model by Guo et al. (2010) doi:10.1109/RAMS.2010.5448029. It fits
a log-log linear regression of cumulative failures versus cumulative time. The
function accepts either two numeric vectors (times, failures) or a data frame
containing both. The Piecewise NHPP model can automatically detect change points
or use user-specified breakpoints.
rga(
times,
failures,
times_type = c("failure_times", "cumulative_failure_times"),
model_type = "Crow-AMSAA",
breaks = NULL,
conf_level = 0.95,
method = c("LS", "MLE")
)The function returns an object of class rga that contains:
The input time vector, stored exactly as supplied.
The cumulative time vector used for fitting.
How times was interpreted: "failure_times" or "cumulative_failure_times".
The input number of failures.
The number of observations (failures).
Cumulative failures.
The fitted model object (lm (linear model) or segmented).
Model residuals on the log-log scale. These represent deviations of the observed log cumulative failures from the fitted values and are useful for diagnostic checking.
The log-likelihood of the fitted model. The log-likelihood is a measure of model fit, with higher values indicating a better fit.
Akaike Information Criterion (AIC). AIC is a measure used for model selection, with lower values indicating a better fit.
Bayesian Information Criterion(BIC). BIC is another criterion for model selection
Breakpoints (log scale) if applicable.
Fitted cumulative failures on the original scale.
Lower confidence bounds (original scale).
Upper confidence bounds (original scale).
Estimated beta(s). Betas are the slopes of the log-log plot.
Standard error(s) of the estimated beta(s).
Estimated growth rate(s). Growth rates are calculated as 1 - beta.
Estimated lambda(s). Lambdas are the intercepts of the log-log plot.
Either a numeric vector of failure-time inputs or a data frame
containing both time inputs and failure counts. If times_type = "failure_times"
(default), times is treated exactly as in previous versions of the function
and is cumulatively summed inside rga(). If
times_type = "cumulative_failure_times", times is treated as already
cumulative and is used directly without applying cumsum(). If a data frame
is provided, it must contain two columns: times and failures.
A numeric vector of the number of failures at each corresponding time
in times. Must be the same length as times if both are vectors. All values must be
positive and finite. Ignored if times is a data frame.
Character scalar indicating how to interpret times.
"failure_times" (default) preserves the current behavior and cumulatively
sums times inside rga(). "cumulative_failure_times" treats times
as already cumulative and skips that internal cumsum().
The model type. Either Crow-AMSAA (default) or Piecewise NHPP with change point detection.
An optional vector of breakpoints for the Piecewise NHPP model.
The desired confidence level, which defaults to 95%. The confidence level is the probability that the confidence interval contains the true mean response.
Estimation method: "LS" (default) for least-squares
log-log regression, or "MLE" for maximum likelihood estimation of
the Crow-AMSAA model. "MLE" is not supported for
model_type = "Piecewise NHPP".
The scaling relationship between the size of input data (numbers of observations)
and speed of algorithm execution is approximately linear (O(n)). The function is
efficient and can handle large data sets (e.g., thousands of observations) quickly.
The function uses the segmented package for piecewise regression, which employs
an iterative algorithm to estimate breakpoints. The number of iterations required
for convergence may vary depending on the data and initial values.
In practice, the function typically converges within a few iterations for most data sets.
However, in some cases, especially with complex data or poor initial values,
it may take more iterations.
Other Reliability Growth Analysis:
plot.rga(),
plot.rga_predict(),
predict_rga(),
print.rga(),
print.rga_predict()
times <- c(100, 200, 300, 400, 500)
failures <- c(1, 2, 1, 3, 2)
result1 <- rga(times, failures)
print(result1)
df <- data.frame(times = times, failures = failures)
result2 <- rga(df)
print(result2)
cum_times <- cumsum(times)
result2b <- rga(cum_times, failures, times_type = "cumulative_failure_times")
print(result2b)
result3 <- rga(times, failures, model_type = "Piecewise NHPP")
print(result3)
result4 <- rga(times, failures, model_type = "Piecewise NHPP", breaks = c(450))
print(result4)
Run the code above in your browser using DataLab