% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pmm2_ts_main.R
\name{sarima_pmm2}
\alias{sarima_pmm2}
\title{Fit a Seasonal ARIMA model using PMM2 method}
\usage{
sarima_pmm2(
  x,
  order = c(0, 1, 0, 1),
  seasonal = list(order = c(1, 1), period = 12),
  method = "pmm2",
  pmm2_variant = c("unified_global", "unified_iterative", "linearized"),
  include.mean = NULL,
  max_iter = 50,
  tol = 1e-06,
  regularize = TRUE,
  reg_lambda = 1e-08,
  ma_method = c("mle", "pmm2"),
  verbose = FALSE,
  multiplicative = TRUE
)
}
\arguments{
\item{x}{Numeric vector of time series data}

\item{order}{Vector of length 4: c(p, P, q, Q) where:
\itemize{
\item p: Non-seasonal AR order
\item P: Seasonal AR order
\item q: Non-seasonal MA order
\item Q: Seasonal MA order
}}

\item{seasonal}{List with seasonal specification: list(order = c(d, D), period = s)
\itemize{
\item d: Non-seasonal differencing order
\item D: Seasonal differencing order
\item period: Seasonal period (s)
}}

\item{method}{Estimation method: "pmm2" (default), "css-ml", "css"}

\item{pmm2_variant}{Character string specifying PMM2 implementation variant.
Options: \code{"unified_global"} (default, one-step correction),
\code{"unified_iterative"} (full Newton-Raphson, \strong{recommended for SARIMA}), or
\code{"linearized"} (specialized for MA/SMA models).}

\item{include.mean}{Logical, include drift term (default TRUE for d+D=0, FALSE otherwise)}

\item{max_iter}{Maximum iterations for PMM2 algorithm (default 50)}

\item{tol}{Convergence tolerance (default 1e-6)}

\item{regularize}{Logical, use regularization for numerical stability (default TRUE)}

\item{reg_lambda}{Regularization parameter (default 1e-8)}

\item{ma_method}{Method for MA/SMA estimation: "mle" (default) or "pmm2"}

\item{verbose}{Logical, print progress information (default FALSE)}

\item{multiplicative}{Logical, use multiplicative seasonal model form with
cross-terms between non-seasonal and seasonal components (default TRUE).
If FALSE, uses additive form.}
}
\value{
S4 object of class SARIMAPMM2 containing:
\itemize{
\item coefficients: Estimated parameters
\item residuals: Model residuals/innovations (padded with zeros to match original length)
\item m2, m3, m4: Central moments of residuals
\item convergence: Convergence status
\item iterations: Number of iterations performed
}
}
\description{
Fits a Seasonal Autoregressive Integrated Moving Average (SARIMA) model
with both non-seasonal and seasonal differencing operators.
}
\details{
The SARIMA(p,d,q) x (P,D,Q)_s model satisfies
\deqn{(1 - \phi_1 B - \dots - \phi_p B^p)(1 - \Phi_1 B^s - \dots - \Phi_P B^{Ps})(1 - B)^d (1 - B^s)^D y_t = (1 + \theta_1 B + \dots + \theta_q B^q)(1 + \Theta_1 B^s + \dots + \Theta_Q B^{Qs}) \epsilon_t.}

Where B is the backshift operator. The model combines:
\itemize{
\item Non-seasonal differencing: (1-B)^d
\item Seasonal differencing: (1-B^s)^D
\item Non-seasonal ARMA components
\item Seasonal ARMA components
}

\strong{Variant Recommendations for SARIMA:}
\itemize{
\item \code{"unified_iterative"} (recommended): Monte Carlo experiments showed
16.4\\% MSE improvement over MLE for SARIMA models - best accuracy for complex
seasonal dynamics
\item \code{"unified_global"} (default): Faster alternative with good accuracy
\item \code{"linearized"}: Not recommended for SARIMA (designed for MA/SMA)
}
}
\examples{
\donttest{
set.seed(123)
n <- 200
y <- arima.sim(n = n,
  model = list(order = c(1, 0, 1), ar = 0.5, ma = 0.3,
    seasonal = list(order = c(1, 0, 0), ar = 0.4, period = 12)))
fit <- sarima_pmm2(y,
  order = c(1, 0, 1, 0),
  seasonal = list(order = c(1, 0), period = 12))
summary(fit)
}

}
\references{
Monte Carlo validation (R=50, n=200): Unified Iterative achieved 16.4\\% MSE
improvement for SARIMA models. See NEWS.md (Version 0.2.0).
}
\seealso{
\code{\link{sarma_pmm2}}, \code{\link{arima_pmm2}}
}
