Learn R Programming

FluxPoint (version 0.1.2)

estimate_RWVAR_cp_heter: Robust parameter estimation (RPE) for multivariate time series

Description

Applies the robust parameter estimation (RPE) procedure componentwise to a multivariate time series in order to estimate the diagonal elements of \(\Sigma_{\boldsymbol{\eta}}\), \(\Sigma_{\boldsymbol{\nu}}\), and \(\Phi\).

Usage

estimate_RWVAR_cp_heter(
  data,
  L = 15,
  phiLower = -0.8,
  phiUpper = 0.8,
  sigetaLower = 0,
  sigetaUpper = Inf,
  signuLower = 1e-06,
  signuUpper = Inf,
  num_inis = 20,
  CPs = NULL
)

Value

A list containing:

  • `Sig_nu` — Diagonal matrix of estimated \(\sigma_{\nu,i}^2\).

  • `Sig_eta` — Diagonal matrix of estimated \(\sigma_{\eta,i}^2\).

  • `Phi` — Diagonal matrix of estimated autoregressive coefficients \(\phi_i\).

Arguments

data

Numeric matrix of dimension \(n \times p\), representing the multivariate time series \(\{\mathbf{y}_t\}_{t=1}^n\).

L

Integer; number of lag differences used in each univariate RPE estimation (default = 15).

phiLower, phiUpper

Numeric; lower and upper bounds for the autoregressive coefficient \(\phi\).

sigetaLower, sigetaUpper

Numeric; lower and upper bounds for \(\sigma_{\eta}^2\), the random walk innovation variance.

signuLower, signuUpper

Numeric; lower and upper bounds for \(\sigma_{\nu}^2\), the VAR(1) innovation variance.

num_inis

Integer; number of initial values of \(\phi\) used for grid search initialization (default = 20).

CPs

Optional numeric vector of change point locations (indices). If provided, differenced data overlapping these points are removed for more robust estimation.

Details

This function performs the RPE procedure for each variable (column) in `data` independently, using estimate_RWVAR_cp as the univariate estimator. The resulting estimates are combined into diagonal matrices:

  • \(\Sigma_{\boldsymbol{\nu}}\) — estimated innovation covariance of the VAR(1) component.

  • \(\Sigma_{\boldsymbol{\eta}}\) — estimated innovation covariance of the random walk component.

  • \(\Phi\) — estimated autoregressive coefficient matrix.

Examples

Run this code
set.seed(123)
p <- 3

# True (diagonal) parameters for simulation
mu0    <- rep(0, p)
Sig_eta <- diag(0.01, p)
Sig_nu  <- random_Signu(p, 0)   # diagonal here since num_nonzero = 0
Phi     <- random_Phi(p, 0)     # diagonal here since num_nonzero = 0
Sig_e1  <- get_Sig_e1_approx(Sig_nu, Phi)

# Two evenly spaced change points
deltas <- list(c(3, 0, -3), c(-2, 4, 0))
Y <- generate_data(mu0, deltas, Sig_eta, Sig_nu, Phi, Sig_e1,
                   errortype = "n", number_cps = 2, lengthofeachpart = 100)

# Provide CP locations to remove affected differences in RPE
CPs <- c(100, 200)

# Componentwise robust parameter estimation
fit <- estimate_RWVAR_cp_heter(Y, L = 15, CPs = CPs)

# Estimated diagonal matrices:
fit$Sig_eta
fit$Sig_nu
fit$Phi

Run the code above in your browser using DataLab