% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidy_rga.R
\name{tidy_rga}
\alias{tidy_rga}
\title{Extract Tidy Fitted Values from an rga Object.}
\usage{
tidy_rga(rga_obj)
}
\arguments{
\item{rga_obj}{An object of class `'rga'`, or a list of such objects. Each
object is created using the [ReliaGrowR::rga()] function.}
}
\value{
A named list with two elements:
  \describe{
    \item{`fitted`}{For a single object, a `data.frame` with columns
      `time`, `cum_failures`, `fitted`, `lower`, `upper`. For a list, a
      list of such data frames (one per object).}
    \item{`params`}{For a single object, a one-row `data.frame` with columns
      `lambda` and `beta` (Crow-AMSAA Power Law parameters), or `NULL` if
      the model coefficients cannot be extracted. For a list, a list of such
      data frames.}
  }
}
\description{
Returns a tidy data frame of fitted cumulative failure counts, confidence
bounds, and (when available) Crow-AMSAA model coefficients from an `rga`
object. Suitable for exporting results for use in reproducible research
workflows.
}
\details{
The Crow-AMSAA (NHPP Power Law) model gives the expected cumulative
failures as \eqn{E[N(t)] = \lambda t^\beta}. A \eqn{\beta < 1} indicates
reliability growth (decreasing failure rate); \eqn{\beta > 1} indicates
degradation. The parameters are recovered from the fitted log-log linear
model via \code{coef()}: \eqn{\lambda = \exp(\text{intercept})} and
\eqn{\beta} is the slope coefficient.
}
\examples{
library(ReliaGrowR)
times <- c(100, 200, 300, 400, 500)
failures <- c(1, 2, 1, 3, 2)
obj <- rga(times, failures)
result <- tidy_rga(obj)
result$fitted
result$params
}
\references{
Crow, L. H. (1974). Reliability Analysis for Complex Repairable Systems.
In \emph{Reliability and Biometry}, SIAM, pp. 379-410.
}
\seealso{
[plotly_rga()] for the corresponding interactive reliability growth plot.
}
