% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pmm2_ts_main.R
\name{sarma_pmm2}
\alias{sarma_pmm2}
\title{Fit a Seasonal ARMA model using PMM2 method}
\usage{
sarma_pmm2(
  x,
  order = c(0, 1, 0, 1),
  season = list(period = 12),
  method = "pmm2",
  include.mean = TRUE,
  max_iter = 50,
  tol = 1e-06,
  regularize = TRUE,
  reg_lambda = 1e-08,
  verbose = FALSE
)
}
\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{season}{List with seasonal specification: list(period = s)
where s is the seasonal period (e.g., 12 for monthly data)}

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

\item{include.mean}{Logical, include intercept/mean term (default TRUE)}

\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{verbose}{Logical, print progress information (default FALSE)}
}
\value{
S4 object of class SARMAPMM2 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 Moving Average (SARMA) model that combines
both seasonal AR and seasonal MA components, optionally with non-seasonal
AR and MA terms as well.
}
\details{
The SARMA model combines four components:
\itemize{
\item AR(p): \eqn{\phi_1 y_{t-1} + \dots + \phi_p y_{t-p}}
\item Seasonal AR: \eqn{\Phi_1 y_{t-s} + \dots + \Phi_P y_{t-Ps}}
\item MA(q): \eqn{\theta_1 \epsilon_{t-1} + \dots + \theta_q \epsilon_{t-q}}
\item Seasonal MA: \eqn{\Theta_1 \epsilon_{t-s} + \dots + \Theta_Q \epsilon_{t-Qs}}
}

The PMM2 method provides more efficient parameter estimates than ML/CSS when
the innovation distribution is asymmetric (non-Gaussian).
}
\examples{
\donttest{
# Generate synthetic seasonal data with SARMA structure
set.seed(123)
n <- 200
y <- arima.sim(n = n, list(
  ar = 0.5, ma = 0.3,
  seasonal = list(sar = 0.6, sma = 0.4, period = 12)
))

# Fit SARMA(1,1,1,1)_12 model with PMM2
fit <- sarma_pmm2(y, order = c(1, 1, 1, 1), season = list(period = 12))
summary(fit)

# Pure seasonal model (no non-seasonal components)
fit_pure <- sarma_pmm2(y, order = c(0, 1, 0, 1), season = list(period = 12))
}

}
\seealso{
\code{\link{sar_pmm2}}, \code{\link{sma_pmm2}}, \code{\link{sarima_pmm2}}
}
