Learn R Programming

EstemPMM (version 0.1.1)

ts_pmm2: Fit a time series model using the PMM2 method

Description

Fit a time series model using the PMM2 method

Usage

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
)

Value

An S4 object TS2fit of the corresponding subclass

Arguments

x

Numeric vector of time series data

order

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)

model_type

String specifying the model type: "ar", "ma", "arma", or "arima"

method

String: estimation method, one of "pmm2" (default), "css", "ml", "yw", "ols"

max_iter

Integer: maximum number of iterations for the algorithm

tol

Numeric: tolerance for convergence

include.mean

Logical: whether to include a mean (intercept) term

initial

List or vector of initial parameter estimates (optional)

na.action

Function for handling missing values, default is na.fail

regularize

Logical, add small values to diagonal for numerical stability

reg_lambda

Regularization parameter (if regularize=TRUE)

verbose

Logical: whether to print progress information

Details

The PMM2 algorithm works as follows:

  1. Fits an initial model using a standard method (OLS, Yule-Walker, CSS or ML)

  2. Computes central moments (m2, m3, m4) from initial residuals/innovations

  3. Uses these moments with a specialized solver (pmm2_algorithm) to find robust parameter estimates