Fit a time series model using the PMM2 method
ts_pmm2(
x,
order,
model_type = c("ar", "ma", "arma", "arima"),
method = "pmm2",
max_iter = 50,
tol = 1e-06,
include.mean = TRUE,
initial = NULL,
na.action = na.fail,
regularize = TRUE,
reg_lambda = 1e-08,
verbose = FALSE
)An S4 object TS2fit of the corresponding subclass
Numeric vector of time series data
Model order specification: - For AR models: a single integer (AR order) - For MA models: a single integer (MA order) - For ARMA models: vector c(p, q) (AR and MA orders) - For ARIMA models: vector c(p, d, q) (AR, differencing, and MA orders)
String specifying the model type: "ar", "ma", "arma", or "arima"
String: estimation method, one of "pmm2" (default), "css", "ml", "yw", "ols"
Integer: maximum number of iterations for the algorithm
Numeric: tolerance for convergence
Logical: whether to include a mean (intercept) term
List or vector of initial parameter estimates (optional)
Function for handling missing values, default is na.fail
Logical, add small values to diagonal for numerical stability
Regularization parameter (if regularize=TRUE)
Logical: whether to print progress information
The PMM2 algorithm works as follows:
Fits an initial model using a standard method (OLS, Yule-Walker, CSS or ML)
Computes central moments (m2, m3, m4) from initial residuals/innovations
Uses these moments with a specialized solver (pmm2_algorithm) to find robust parameter estimates