% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ENI.R
\name{ENI}
\alias{ENI}
\title{Mortality ensemble interval}
\usage{
ENI(..., width = 0.95, method = 1, wm, nsim = 10, seed = 123)
}
\arguments{
\item{...}{fitted model objects returned by \code{LCS()}, \code{RHS()}, \code{APCS()}, \code{CBDS()}, \code{CBDCS()}, \code{CBDQCS()}, and / or \code{STARS()}.}

\item{width}{coverage probability of interval (default = 0.95).}

\item{method}{if 1, simple averaging; if 2, weighted averaging; if 3, envelope; if 4, interior trimming (default = 1).}

\item{wm}{vector of weights for LC, RH, APC, M5, M6, M7, and / or STAR models if method = 2 (default = equal weights).}

\item{nsim}{number of simulations (default = 10).}

\item{seed}{seed for random number generator (default = 123).}
}
\value{
An object of class ENI with associated S3 methods forecast and plot.
}
\description{
Generates ensemble interval forecast of mortality rates.
}
\details{
Ensemble interval forecast is constructed by combining interval forecasts from individual stochastic mortality models using different methods including simple averaging, weighted averaging, envelope, and interior trimming. See \code{LCS()}, \code{RHS()}, \code{APCS()}, \code{CBDS()}, \code{CBDCS()}, \code{CBDQCS()}, and \code{STARS()} for more details of different stochastic mortality models.
}
\examples{
x <- 60:69
a <- c(-4.8499,-4.7676,-4.6719,-4.5722,-4.4847,-4.3841,-4.2813,-4.1863,-4.0861,-3.9962)
b <- c(0.0801,0.0909,0.0948,0.0951,0.0965,0.1014,0.1042,0.1141,0.1110,0.1118)
k <- c(12.11,10.69,11.18,9.64,9.35,8.21,6.89,5.74,4.56,3.60,
3.27,2.04,1.11,-0.44,-1.05,-1.03,-1.84,-2.90,-4.03,-4.12,
-5.18,-5.64,-6.00,-6.51,-6.91,-6.90,-8.32,-8.53,-9.69,-9.31)
set.seed(123)
M <- exp(outer(k,b)+matrix(a,nrow=30,ncol=10,byrow=TRUE)+rnorm(300,0,0.035))
fit1 <- LCS(x=x,M=M,curve="makeham",h=30,jumpoff=2)
fit2 <- RHS(x=x,M=M,curve="makeham",h=30,jumpoff=2)
fit3 <- APCS(x=x,M=M,curve="makeham",h=30,jumpoff=2)
fit4 <- CBDS(x=x,M=M,curve="makeham",h=30,jumpoff=2)
fit <- ENI(fit1,fit2,fit3,fit4)
forecast::forecast(fit)
plot(fit)

}
\references{
Li, J., Wang, M., Liu, J., and Tickle, L. (2025). Ensemble interval forecasts of mortality. Scandinavian Actuarial Journal, 2025(6), 598-616.
}
