filter_svp: Filter Latent Volatility from an Estimated SV(p) Model

View source: R/kalman.R

filter_svpR Documentation

Filter Latent Volatility from an Estimated SV(p) Model

Description

Applies Kalman filtering (corrected or Gaussian mixture) and RTS smoothing to extract the latent log-volatility process from an estimated SV(p) model.

Usage

filter_svp(
  object,
  method = c("corrected", "mixture", "particle"),
  proxy = c("bayes_optimal", "u"),
  K = 7,
  M = 1000,
  seed = 42,
  del = 1e-10
)

Arguments

object

An "svp", "svp_t", or "svp_ged" object from svp.

method

Character. Filter method: "corrected" (default) for standard Kalman with distribution-specific \sigma_\varepsilon^2(\nu), "mixture" for the Gaussian Mixture Kalman Filter (GMKF), or "particle" for the Bootstrap Particle Filter (BPF).

proxy

Character. Leverage proxy for the state-space prediction mean \hat{z}_{t-1} that enters the leverage shift \sigma_\nu \delta_p \hat{z}_{t-1} (the prediction covariance is independently \sigma_\nu^2(1-\delta_p^2) per Rodriguez-Rondon, Dufour and Ahsan (2026), i.e.\ var_zt = 0L). "bayes_optimal" (default) uses the posterior mean E[\zeta_{t-1} \mid u_{t-1}] for Student-t leverage, which corrects the marginal variance inflation of using \hat{u}_{t-1} directly (\mathrm{Var}(\hat{u}) = \nu/(\nu - 2) > 1) and is what the IC functions svp_IC / svp_AR_order use internally. "u" reproduces the paper-faithful proxy of Remark~3.5 (\hat{z}_{t-1} = \hat{u}_{t-1}). Has no effect for Gaussian or GED leverage (the proxy is closed-form in both cases) and no effect when leverage = FALSE.

K

Integer. Number of mixture components for GMKF. Default 7.

M

Integer. Number of particles for BPF. Default 1000.

seed

Integer. Random seed for BPF. Default 42.

del

Numeric. Small constant for log transformation. Default 1e-10.

Value

An object of class "svp_filter", a list containing:

w_filtered

Filtered log-volatility (T-vector).

w_smoothed

Smoothed log-volatility (T-vector).

zt

Filtered standardized residuals.

zt_smoothed

Smoothed standardized residuals.

P_filtered

Filtered MSE of first state component.

P_predicted

Predicted MSE of first state component.

xi_filtered

Full filtered state vectors (p x T matrix).

xi_smoothed

Full smoothed state vectors (p x T matrix).

loglik

Approximate log-likelihood.

method

Filter method used.

model

The input model object.

Examples


y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y
fit <- svp(y, p = 1)
filt <- filter_svp(fit)
plot(filt$w_smoothed, type = "l")



wARMASVp documentation built on May 15, 2026, 5:07 p.m.