% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nhpp.R
\name{nhpp}
\alias{nhpp}
\title{Non-Homogeneous Poisson Process Model for Repairable Systems.}
\usage{
nhpp(
  time,
  event = NULL,
  data = NULL,
  model_type = "Power Law",
  breaks = NULL,
  method = c("MLE", "LS"),
  conf_level = 0.95
)
}
\arguments{
\item{time}{A numeric vector of cumulative event times, or a data frame
containing columns \code{time} and optionally \code{event}. All values
must be positive, finite, and strictly increasing.}

\item{event}{An optional numeric vector of event counts at each time. If
\code{NULL} (default), each time is treated as a single event.}

\item{data}{An optional data frame containing columns \code{time} and
optionally \code{event}.}

\item{model_type}{Model type: \code{"Power Law"} (default) or
\code{"Log-Linear"}.}

\item{breaks}{Optional vector of breakpoints for piecewise Power Law model.}

\item{method}{Estimation method: \code{"MLE"} (default) or \code{"LS"}.
\code{"LS"} is not supported for \code{"Log-Linear"} models.}

\item{conf_level}{Confidence level for bounds (default 0.95).}
}
\value{
An object of class \code{nhpp} containing:
\item{time}{The input cumulative event times.}
\item{event}{The event counts.}
\item{cum_events}{Cumulative event counts.}
\item{n_obs}{Number of observations.}
\item{model}{Fitted model object (lm or segmented), or NULL for MLE.}
\item{model_type}{\code{"Power Law"} or \code{"Log-Linear"}.}
\item{method}{\code{"MLE"} or \code{"LS"}.}
\item{params}{Named list of estimated parameters.}
\item{params_se}{Named list of standard errors.}
\item{vcov}{Variance-covariance matrix (MLE only).}
\item{fitted_values}{Fitted cumulative events.}
\item{lower_bounds}{Lower confidence bounds.}
\item{upper_bounds}{Upper confidence bounds.}
\item{residuals}{Model residuals.}
\item{logLik}{Log-likelihood.}
\item{AIC}{Akaike Information Criterion.}
\item{BIC}{Bayesian Information Criterion.}
\item{breakpoints}{Breakpoints (log scale) if piecewise model.}
\item{conf_level}{Confidence level used.}
}
\description{
Fits a parametric NHPP model to recurrent event data from repairable systems.
Supported models include the Power Law process and the Log-Linear process.
The Power Law model can also be fit as a piecewise (segmented) model with
automatic change point detection or user-specified breakpoints.
}
\details{
The \strong{Power Law NHPP} models the cumulative number of events as
\eqn{N(t) = \lambda t^\beta}{N(t) = lambda * t^beta}. The parameter
\eqn{\beta > 1} indicates a deteriorating system (increasing event rate),
\eqn{\beta < 1} an improving system, and \eqn{\beta = 1} a constant rate
(HPP).

The \strong{Log-Linear NHPP} models the intensity as
\eqn{\lambda(t) = \exp(a + bt)}{lambda(t) = exp(a + b*t)} with cumulative
function \eqn{\Lambda(t) = \frac{e^a}{b}(e^{bt} - 1)}{Lambda(t) = (exp(a)/b)(exp(bt) - 1)}.
}
\examples{
time <- c(200, 400, 600, 800, 1000)
event <- c(3, 5, 4, 7, 6)
result <- nhpp(time, event)
print(result)
plot(result, main = "Power Law NHPP")

result_ll <- nhpp(time, event, model_type = "Log-Linear")
print(result_ll)
}
\seealso{
Other Repairable Systems Analysis: 
\code{\link{exposure}()},
\code{\link{mcf}()},
\code{\link{overlay_nhpp}()},
\code{\link{plot.exposure}()},
\code{\link{plot.mcf}()},
\code{\link{plot.nhpp}()},
\code{\link{plot.nhpp_predict}()},
\code{\link{predict_nhpp}()},
\code{\link{print.exposure}()},
\code{\link{print.mcf}()},
\code{\link{print.nhpp}()},
\code{\link{print.nhpp_predict}()}
}
\concept{Repairable Systems Analysis}
