% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\name{forecast.modal_arima}
\alias{forecast.modal_arima}
\title{Forecast methodology for Modal ARIMA}
\usage{
\method{forecast}{modal_arima}(
  object,
  h = 10,
  level = c(80, 95),
  interval = c("asymptotic", "bootstrap"),
  npaths = 1000,
  ...
)
}
\arguments{
\item{object}{A modal_arima object.}

\item{h}{The forecast horizon.}

\item{level}{Confidence level for prediction intervals.}

\item{interval}{Method for computing prediction intervals ("asymptotic" or "bootstrap").}

\item{npaths}{Number of simulated paths for bootstrap intervals. Defaults to 1000.}

\item{...}{Additional arguments.}
}
\value{
A forecast object.
}
\description{
Forecast methodology for Modal ARIMA
}
\examples{
library(forecast)

# 1. Load Empirical Data (Lynx)
data(lynx)
y <- log10(lynx)

# 2. Find the best SKD Error Distribution (Normal vs T vs Laplace) 
fit_n <- fit_modal_arima(y, order = c(2, 0, 0), dist = "normal")
fit_t <- fit_modal_arima(y, order = c(2, 0, 0), dist = "t")
fit_l <- fit_modal_arima(y, order = c(2, 0, 0), dist = "laplace")
c(Normal = AIC(fit_n), Student = AIC(fit_t), Laplace = AIC(fit_l))

# 3. Auto Model Selection globally on the winning distribution (Skew-Normal)
fit_auto <- auto.modal.arima(y, d=0, max.p=2, max.q=2, dist="normal")

# 4. Summary & Inferences
summary(fit_auto)

# 5. Run residual diagnostics and Envelopes
diagnostics(fit_auto)
envelope(fit_auto, B=10)

# 6. Produce forecasts with multiple prediction bands (alphas)
pred <- forecast(fit_auto, h=5, level = c(80, 95))

# 7. Native integration with 'forecast' ecosystem
autoplot(pred)    
accuracy(pred)
}
