svp: Estimate a Stochastic Volatility Model

View source: R/estim.R

svpR Documentation

Estimate a Stochastic Volatility Model

Description

Master estimation function for SV(p) models using the Winsorized ARMA-SV (W-ARMA-SV) method. Supports Gaussian, Student-t, and GED error distributions, with optional leverage effects.

Usage

svp(
  y,
  p = 1,
  J = 10,
  leverage = FALSE,
  errorType = "Gaussian",
  rho_type = "pearson",
  del = 1e-10,
  trunc_lev = TRUE,
  wDecay = FALSE,
  logNu = FALSE,
  sigvMethod = "factored",
  winsorize_eps = 0
)

Arguments

y

Numeric vector. Observed returns (e.g., de-meaned log returns).

p

Integer. Order of the volatility process. Default is 1.

J

Integer. Winsorizing parameter controlling the number of autocovariance blocks used. Default is 10.

leverage

Logical. If TRUE, estimate leverage parameter \rho. Default is FALSE.

errorType

Character. Error distribution: "Gaussian" (default), "Student-t", or "GED".

rho_type

Character. Correlation type for leverage estimation. One of "pearson" (default), "kendall", or "both".

del

Numeric. Small constant for log transformation: \log(y_t^2 + \delta). Default is 1e-10.

trunc_lev

Logical. If TRUE, truncate the estimated leverage parameter to [-0.999, 0.999]. Default is TRUE. Setting to FALSE can reduce bias in some cases but may yield estimates outside the parameter space.

wDecay

Logical. Use linearly decaying weights in the WLS estimation. Default is FALSE.

logNu

Logical. Solve for \nu in log-space for numerical stability (Student-t only). Default is FALSE.

sigvMethod

Character. Method for estimating \sigma_v. One of: "factored" (default) — factored-variance estimator (recommended; dominates RMSE in most settings, see ADRR 2025); "direct" — direct variance decomposition; "hybrid" — AD2021 closed-form for p = 1, falls back to "direct" for p \ge 2 (Student-t and GED only).

winsorize_eps

Integer. Number of extreme autocovariance lags to winsorize (0 = none). Used in Student-t and GED \sigma_\varepsilon^2 estimation. Default 0.

Details

The model is:

y_t = \sigma_y \exp(w_t / 2) z_t

w_t = \phi_1 w_{t-1} + \cdots + \phi_p w_{t-p} + \sigma_v v_t

where z_t follows a distribution specified by errorType (Gaussian, Student-t, or GED), and v_t is i.i.d. standard normal. When leverage = TRUE, the correlation between z_t and v_t is estimated as \rho.

For Student-t errors with leverage, the correction factor C_t(\nu) from the scale-mixture representation is applied. For GED errors with leverage, the exact implicit equation is solved via 1D root-finding with Gauss-Hermite quadrature.

Value

Depending on errorType:

  • "Gaussian": An object of class "svp" (see below).

  • "Student-t": An object of class "svp_t".

  • "GED": An object of class "svp_ged".

The "svp" class contains:

mu

Mean of \log(y_t^2 + \delta).

phi

Numeric vector of AR coefficients.

sigv

Standard deviation of volatility innovations.

sigy

Unconditional standard deviation.

rho

Leverage parameter (if estimated, otherwise NA).

y

The original data.

p, J

Model order and winsorizing parameter.

errorType

The error distribution used.

call

The matched call.

References

Ahsan, M. N. and Dufour, J.-M. (2021). Simple estimators and inference for higher-order stochastic volatility models. Journal of Econometrics, 224(1), 181-197. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2021.03.008")}

Ahsan, M. N., Dufour, J.-M., and Rodriguez-Rondon, G. (2026). Estimation and inference for stochastic volatility models with heavy-tailed distributions. Bank of Canada Staff Working Paper 2026-8. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.34989/swp-2026-8")}

See Also

svpSE for standard errors.

Examples


# Gaussian SV(1) without leverage (default)
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y
fit <- svp(y)
summary(fit)

# With leverage
y2 <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y
fit2 <- svp(y2, leverage = TRUE)
coef(fit2)

# Student-t errors
y3 <- sim_svp(1000, phi = 0.9, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5)$y
fit3 <- svp(y3, errorType = "Student-t")
summary(fit3)



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