| Title: | Winsorized ARMA Estimation for Higher-Order Stochastic Volatility Models |
|---|---|
| Description: | Estimation, simulation, hypothesis testing, AR-order selection, and forecasting for univariate higher-order stochastic volatility SV(p) models. Supports Gaussian, Student-t, and Generalized Error Distribution (GED) innovations, with optional leverage effects. Estimation uses closed-form Winsorized ARMA-SV (W-ARMA-SV) moment-based methods that avoid numerical optimization. Hypothesis testing includes Local Monte Carlo (LMC) and Maximized Monte Carlo (MMC) procedures for leverage effects, heavy tails, and autoregressive order. AR-order selection is also available via information criteria (BIC/AIC) using the Kalman-filter quasi-likelihood and the Hannan-Rissanen ARMA residual variance. Forecasting is based on Kalman filtering and smoothing. See Ahsan and Dufour (2021) <doi:10.1016/j.jeconom.2021.03.008>, Ahsan, Dufour, and Rodriguez-Rondon (2025) <doi:10.1111/jtsa.12851>, and Ahsan, Dufour, and Rodriguez-Rondon (2026) <doi:10.34989/swp-2026-8> for details. |
| Authors: | Gabriel Rodriguez-Rondon [aut, cre] (ORCID: <https://orcid.org/0009-0005-3769-9921>), Md. Nazmul Ahsan [aut], Jean-Marie Dufour [aut] |
| Maintainer: | Gabriel Rodriguez-Rondon <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.2.0 |
| Built: | 2026-05-15 06:40:25 UTC |
| Source: | https://github.com/roga11/warmasvp |
Applies Kalman filtering (corrected or Gaussian mixture) and RTS smoothing to extract the latent log-volatility process from an estimated SV(p) model.
filter_svp( object, method = c("corrected", "mixture", "particle"), proxy = c("bayes_optimal", "u"), K = 7, M = 1000, seed = 42, del = 1e-10 )filter_svp( object, method = c("corrected", "mixture", "particle"), proxy = c("bayes_optimal", "u"), K = 7, M = 1000, seed = 42, del = 1e-10 )
object |
An |
method |
Character. Filter method: |
proxy |
Character. Leverage proxy for the state-space prediction
mean |
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 |
An object of class "svp_filter", a list containing:
Filtered log-volatility (T-vector).
Smoothed log-volatility (T-vector).
Filtered standardized residuals.
Smoothed standardized residuals.
Filtered MSE of first state component.
Predicted MSE of first state component.
Full filtered state vectors (p x T matrix).
Full smoothed state vectors (p x T matrix).
Approximate log-likelihood.
Filter method used.
The input model object.
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")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")
Applies Kalman filtering/smoothing to an estimated SV(p) model and produces multi-step ahead volatility forecasts with uncertainty quantification.
forecast_svp( object, H = 1, output = c("log-variance", "variance", "volatility"), filter_method = "corrected", proxy = c("bayes_optimal", "u"), K = 7, M = 1000, seed = 42, del = 1e-10 )forecast_svp( object, H = 1, output = c("log-variance", "variance", "volatility"), filter_method = "corrected", proxy = c("bayes_optimal", "u"), K = 7, M = 1000, seed = 42, del = 1e-10 )
object |
An |
H |
Integer. Maximum forecast horizon. Default 1. |
output |
Character. Primary output scale: |
filter_method |
Character. Filter method: |
proxy |
Character. Leverage proxy for the filter and the h=1 forecast
shift. |
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 |
An object of class "svp_forecast", a list containing:
Primary forecast (scale determined by output).
Log-volatility forecasts .
Conditional variance forecasts .
Conditional volatility forecasts .
Forecast MSE for each horizon.
Filtered log-volatility.
Smoothed log-volatility.
Filtered standardized residuals.
Smoothed standardized residuals.
Demeaned log-squared returns.
The estimated model object.
The forecast horizon.
The chosen output scale.
The "svp_filter" object from filtering.
sim <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3) fit <- svp(sim$y, p = 1, leverage = TRUE) fc <- forecast_svp(fit, H = 10) plot(fc)sim <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3) fit <- svp(sim$y, p = 1, leverage = TRUE) fc <- forecast_svp(fit, H = 10) plot(fc)
Performs a Local Monte Carlo (LMC) test of the null hypothesis
(i.e., that an SV()
model is sufficient against an SV() alternative).
lmc_ar( y, p_null, p_alt, J = 10, N = 99, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", sigvMethod = "factored", logNu = TRUE, winsorize_eps = 0 )lmc_ar( y, p_null, p_alt, J = 10, N = 99, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", sigvMethod = "factored", logNu = TRUE, winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p_null |
Integer. Order under the null hypothesis. |
p_alt |
Integer. Order under the alternative ( |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
burnin |
Integer. Burn-in for simulation. Default 500. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. If |
Amat |
Weighting matrix specification. |
errorType |
Character. Error distribution of the return innovations:
|
sigvMethod |
Character. Method for |
logNu |
Logical. Use log-space for |
winsorize_eps |
Number of extreme autocovariance lags to winsorize (heavy-tail only). Default 0. |
When Bartlett = FALSE (default), the test statistic is
, i.e., the sum of squared extra
AR coefficients scaled by sample size.
When Bartlett = TRUE, the test statistic is based on the GMM-LRT
approach with a Bartlett kernel HAC weighting matrix:
, where denotes the
GMM criterion evaluated at the null and alternative estimates. Both the
observed and simulated test statistics are capped at 1e-10 when
negative; a negative observed statistic raises a warning (it indicates strong
evidence in favour of the null, since the alternative does not improve the
GMM criterion).
An object of class "svp_test", a list containing:
Test statistic from observed data (capped at 1e-10 if negative).
Simulated null distribution (vector of length N).
Monte Carlo p-value.
Character string identifying the test.
Name of the parameter(s) tested.
Value(s) under the null hypothesis.
Error distribution used.
The matched call.
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y test <- lmc_ar(y, p_null = 1, p_alt = 2, J = 10, N = 49) print(test)y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y test <- lmc_ar(y, p_null = 1, p_alt = 2, J = 10, N = 49) print(test)
Performs a Local Monte Carlo (LMC) test of the null hypothesis
for the shape parameter in an SV(p) model
with GED errors. Testing corresponds to testing normality.
lmc_ged( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )lmc_ged( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. AR order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
nu_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. Use Bartlett kernel HAC for weighting matrix.
Default |
Amat |
Weighting matrix specification. |
direction |
Character. Test direction: |
sigvMethod |
Character. Method for |
winsorize_eps |
Numeric. Winsorization threshold for moment conditions. Default 0 (no winsorization). |
An object of class "svp_test".
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5)$y test <- lmc_ged(y, p = 1, J = 10, N = 49, nu_null = 2) print(test)y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5)$y test <- lmc_ged(y, p = 1, J = 10, N = 49, nu_null = 2) print(test)
Performs a Local Monte Carlo (LMC) test of the null hypothesis
(typically , i.e., no leverage)
using a GMM likelihood-ratio type statistic.
lmc_lev( y, p = 1, J = 10, N = 99, rho_null = 0, burnin = 500, rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0 )lmc_lev( y, p = 1, J = 10, N = 99, rho_null = 0, burnin = 500, rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. Order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
rho_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
rho_type |
Character. Correlation type. Default |
del |
Numeric. Small constant for log transformation. Default |
trunc_lev |
Logical. Truncate leverage correlation estimate to
|
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. If |
Amat |
Weighting matrix specification. |
errorType |
Character. Error distribution: |
logNu |
Logical. Use log-space for nu estimation (Student-t only).
Default |
sigvMethod |
Method for sigma_v estimation: |
winsorize_eps |
Number of extreme autocovariance lags to winsorize (0 = none). Default 0. |
An object of class "svp_test", a list containing:
Test statistic from observed data.
Simulated null distribution (vector of length N).
Monte Carlo p-value.
Character string identifying the test.
Name of the parameter tested.
Value under the null hypothesis.
The matched call.
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y test <- lmc_lev(y, p = 1, J = 10, N = 99) print(test)y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y test <- lmc_lev(y, p = 1, J = 10, N = 99) print(test)
Performs a Local Monte Carlo (LMC) test of the null hypothesis
for the degrees of freedom parameter in an
SV(p) model with Student-t errors. Testing
(or a large value) corresponds to testing for normality.
lmc_t( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, logNu = TRUE, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )lmc_t( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, logNu = TRUE, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. AR order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
nu_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. Use Bartlett kernel HAC for weighting matrix.
Default |
Amat |
Weighting matrix specification. |
logNu |
Logical. Use log-space for nu estimation. Default |
direction |
Character. Test direction: |
sigvMethod |
Character. Method for |
winsorize_eps |
Numeric. Winsorization threshold for moment conditions. Default 0 (no winsorization). |
An object of class "svp_test".
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5)$y test <- lmc_t(y, p = 1, J = 10, N = 49, nu_null = 5) print(test)y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5)$y test <- lmc_t(y, p = 1, J = 10, N = 49, nu_null = 5) print(test)
Performs a Maximized Monte Carlo (MMC) test of
by maximizing the MC p-value over nuisance parameters
().
mmc_ar( y, p_null, p_alt, J = 10, N = 99, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", sigvMethod = "factored", logNu = TRUE, winsorize_eps = 0 )mmc_ar( y, p_null, p_alt, J = 10, N = 99, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", sigvMethod = "factored", logNu = TRUE, winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p_null |
Integer. Order under the null hypothesis. |
p_alt |
Integer. Order under the alternative ( |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
burnin |
Integer. Burn-in for simulation. Default 500. |
eps |
Numeric vector. Half-width of search region around estimated
nuisance parameters. Default |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum iterations/evaluations. Default depends on method. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. If |
Amat |
Weighting matrix specification. |
errorType |
Character. Error distribution of the return innovations:
|
sigvMethod |
Character. Method for |
logNu |
Logical. Use log-space for |
winsorize_eps |
Number of extreme autocovariance lags to winsorize (heavy-tail only). Default 0. |
A list with optimization output including value (maximized p-value)
and par (nuisance parameters at the maximum).
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y mmc <- mmc_ar(y, p_null = 1, p_alt = 2, J = 10, N = 19, method = "pso", maxit = 10) mmc$valuey <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y mmc <- mmc_ar(y, p_null = 1, p_alt = 2, J = 10, N = 19, method = "pso", maxit = 10) mmc$value
Performs a Maximized Monte Carlo (MMC) test of
for the GED shape parameter.
mmc_ged( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )mmc_ged( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. AR order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
nu_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
eps |
Numeric vector. Half-width of search region around estimated nuisance
parameters. Must have length |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum iterations/evaluations. Default depends on method. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. Use Bartlett kernel HAC for weighting matrix.
Default |
Amat |
Weighting matrix specification. |
direction |
Character. Test direction: |
sigvMethod |
Character. Method for |
winsorize_eps |
Numeric. Winsorization threshold for moment conditions. Default 0 (no winsorization). |
A list with optimization output including value (maximized p-value)
and par (nuisance parameters at the maximum).
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5)$y mmc <- mmc_ged(y, p = 1, J = 10, N = 19, nu_null = 2, method = "pso", maxit = 10) mmc$valuey <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5)$y mmc <- mmc_ged(y, p = 1, J = 10, N = 19, nu_null = 2, method = "pso", maxit = 10) mmc$value
Performs a Maximized Monte Carlo (MMC) test of the null hypothesis
by maximizing the MC p-value over nuisance
parameters (phi, sigma_y, sigma_v).
mmc_lev( y, p = 1, J = 10, N = 99, rho_null = 0, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0 )mmc_lev( y, p = 1, J = 10, N = 99, rho_null = 0, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, errorType = "Gaussian", logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. Order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
rho_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
eps |
Numeric vector. Half-width of the search region around the
estimated nuisance parameters. For Gaussian: length |
threshold |
Numeric. Target p-value (optimization stops if reached). Default 1. |
method |
Character. Optimization method: |
maxit |
Integer or list. Maximum iterations/evaluations for the optimizer. Default depends on method. |
rho_type |
Character. Correlation type. Default |
del |
Numeric. Small constant for log transformation. Default |
trunc_lev |
Logical. Truncate leverage correlation estimate to
|
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. If |
Amat |
Weighting matrix specification. |
errorType |
Character. Error distribution: |
logNu |
Logical. Use log-space for nu estimation (Student-t only).
Default |
sigvMethod |
Method for sigma_v estimation: |
winsorize_eps |
Number of extreme autocovariance lags to winsorize (0 = none). Default 0. |
A list with the optimization output including:
Maximized p-value.
Nuisance parameter values at the maximum.
Additional fields depend on the optimization method used.
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y mmc <- mmc_lev(y, p = 1, J = 10, N = 19, method = "pso", maxit = 10) mmc$valuey <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y mmc <- mmc_lev(y, p = 1, J = 10, N = 19, method = "pso", maxit = 10) mmc$value
Performs a Maximized Monte Carlo (MMC) test of
by maximizing the MC p-value over nuisance parameters (phi, sigma_y, sigma_v).
mmc_t( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, logNu = TRUE, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )mmc_t( y, p = 1, J = 10, N = 99, nu_null, burnin = 500, eps = NULL, threshold = 1, method = "pso", maxit = NULL, del = 1e-10, wDecay = FALSE, Bartlett = FALSE, Amat = NULL, logNu = TRUE, direction = c("two-sided", "less", "greater"), sigvMethod = "factored", winsorize_eps = 0 )
y |
Numeric vector. Observed returns. |
p |
Integer. AR order of the volatility process. Default 1. |
J |
Integer. Winsorizing parameter. Default 10. |
N |
Integer. Number of Monte Carlo replications. Default 99. |
nu_null |
Numeric. Value of |
burnin |
Integer. Burn-in for simulation. Default 500. |
eps |
Numeric vector. Half-width of search region around estimated nuisance
parameters. Must have length |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum iterations/evaluations. Default depends on method. |
del |
Numeric. Small constant for log transformation. Default |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. Use Bartlett kernel HAC for weighting matrix.
Default |
Amat |
Weighting matrix specification. |
logNu |
Logical. Use log-space for nu estimation. Default |
direction |
Character. Test direction: |
sigvMethod |
Character. Method for |
winsorize_eps |
Numeric. Winsorization threshold for moment conditions. Default 0 (no winsorization). |
A list with optimization output including value (maximized p-value)
and par (nuisance parameters at the maximum).
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5)$y mmc <- mmc_t(y, p = 1, J = 10, N = 19, nu_null = 5, method = "pso", maxit = 10) mmc$valuey <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5)$y mmc <- mmc_t(y, p = 1, J = 10, N = 19, nu_null = 5, method = "pso", maxit = 10) mmc$value
Master simulation function for SV(p) models. Supports Gaussian, Student-t,
and GED error distributions, with optional leverage effects. This mirrors
the interface of svp for estimation.
sim_svp( n, phi, sigy, sigv, errorType = "Gaussian", leverage = FALSE, rho = 0, nu = NULL, burnin = 500 )sim_svp( n, phi, sigy, sigv, errorType = "Gaussian", leverage = FALSE, rho = 0, nu = NULL, burnin = 500 )
n |
Integer. Length of the simulated series. |
phi |
Numeric vector. AR coefficients for log-volatility (length p). |
sigy |
Numeric. Unconditional standard deviation of returns. |
sigv |
Numeric. Standard deviation of volatility innovations. |
errorType |
Character. Error distribution: |
leverage |
Logical. If |
rho |
Numeric. Leverage parameter (correlation between return and
volatility shocks). Must be in |
nu |
Numeric. Shape parameter for heavy-tailed distributions.
Degrees of freedom for Student-t (must be > 2) or GED shape (must be > 0).
Required when |
burnin |
Integer. Number of initial observations to discard. Default 500. |
The model is:
where follows a distribution specified by errorType
(Gaussian, Student-t, or GED), and is i.i.d. standard normal.
When leverage = TRUE, the correlation between and
is .
For Student-t errors with leverage, the scale-mixture representation
is used, where leverage operates through
the Gaussian component . For GED errors with leverage, a Gaussian
copula construction is used.
In both cases the returned z is the effective return innovation
(not the latent ), with marginal distribution matching the
errorType.
A named list of four length-n numeric vectors:
yObserved returns .
hLog-volatility process (equivalently ).
zReturn innovation such that
.
Marginal distribution matches errorType: N(0,1) for Gaussian,
t() for Student-t, unit-variance GED() for GED.
vVolatility innovation such that
.
Always N(0,1); under leverage, .
svp for estimation.
# Gaussian SV(1), no leverage sim <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2) plot(sim$y, type = "l") # Gaussian SV(1) with leverage sim_lev <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.5) plot(sim_lev$y, type = "l") # Student-t SV(1) sim_t <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5) plot(sim_t$y, type = "l") # GED SV(1) sim_ged <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5) plot(sim_ged$y, type = "l")# Gaussian SV(1), no leverage sim <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2) plot(sim$y, type = "l") # Gaussian SV(1) with leverage sim_lev <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.5) plot(sim_lev$y, type = "l") # Student-t SV(1) sim_t <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "Student-t", nu = 5) plot(sim_t$y, type = "l") # GED SV(1) sim_ged <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, errorType = "GED", nu = 1.5) plot(sim_ged$y, type = "l")
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.
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 )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 )
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 |
errorType |
Character. Error distribution: |
rho_type |
Character. Correlation type for leverage estimation. One of
|
del |
Numeric. Small constant for log transformation:
|
trunc_lev |
Logical. If |
wDecay |
Logical. Use linearly decaying weights in the WLS estimation.
Default is |
logNu |
Logical. Solve for |
sigvMethod |
Character. Method for estimating |
winsorize_eps |
Integer. Number of extreme autocovariance lags to
winsorize ( |
The model is:
where follows a distribution specified by errorType
(Gaussian, Student-t, or GED), and is i.i.d. standard normal.
When leverage = TRUE, the correlation between and
is estimated as .
For Student-t errors with leverage, the correction factor
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.
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:
Mean of .
Numeric vector of AR coefficients.
Standard deviation of volatility innovations.
Unconditional standard deviation.
Leverage parameter (if estimated, otherwise NA).
The original data.
Model order and winsorizing parameter.
The error distribution used.
The matched call.
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. 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. doi:10.34989/swp-2026-8
svpSE for standard errors.
# 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)# 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)
Convenience wrapper around svp_IC: fits svp
at each p = 1, ..., pmax and returns a matrix of information
criteria along with the argmin per criterion.
svp_AR_order( y, pmax = 6L, J = 10L, leverage = FALSE, errorType = "Gaussian", rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0L, filter_method = "mixture", proxy = c("bayes_optimal", "u"), K = 7L, M = 1000L, seed = 42L, criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR") )svp_AR_order( y, pmax = 6L, J = 10L, leverage = FALSE, errorType = "Gaussian", rho_type = "pearson", del = 1e-10, trunc_lev = TRUE, wDecay = FALSE, logNu = FALSE, sigvMethod = "factored", winsorize_eps = 0L, filter_method = "mixture", proxy = c("bayes_optimal", "u"), K = 7L, M = 1000L, seed = 42L, criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR") )
y |
Numeric vector. Observed returns. |
pmax |
Integer. Maximum AR order to consider. Default 6. |
J |
Integer. Winsorizing parameter passed to |
leverage |
Logical. Whether to estimate leverage. Default
|
errorType |
Character. |
rho_type, del, trunc_lev, wDecay, logNu, sigvMethod, winsorize_eps
|
Other
arguments passed to |
filter_method |
Character. Filter method for |
proxy |
Character. Leverage proxy. Default |
K, M, seed
|
Filter arguments passed to |
criteria |
Character vector of criteria to compute. Default
returns the four recommended criteria: |
A list with components:
Numeric matrix, one row per criterion, one column per
candidate p in 1:pmax.
Named integer vector, one entry per criterion, giving the
selected p. NA_integer_ if all entries for that
criterion are NA.
List of length pmax containing the fitted
svp() objects (or NULL if a fit failed).
set.seed(1) y <- sim_svp(2000, phi = 0.95, sigy = 1, sigv = 0.5)$y res <- svp_AR_order(y, pmax = 4) res$IC res$argminset.seed(1) y <- sim_svp(2000, phi = 0.95, sigy = 1, sigv = 0.5)$y res <- svp_AR_order(y, pmax = 4) res$IC res$argmin
Computes information criteria for an svp fit to support
AR-order selection. Eight criteria are computable; four are
returned by default — BIC_Kalman, AIC_Kalman,
BIC_HR, AIC_HR. These span two families (state-space QML
and Hannan–Rissanen two-stage ARMA) and two penalty philosophies
(Schwarz-consistent BIC / Shibata-efficient AIC), and were selected as
the most informative criteria across the simulation grid of the
SVHT methodology paper (Ahsan, Dufour and Rodriguez-Rondon 2026).
The remaining four are available on request via the criteria
argument.
svp_IC( fit, criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR"), filter_method = c("mixture", "corrected", "particle"), proxy = c("bayes_optimal", "u"), K = 7L, M = 1000L, seed = 42L, del = 1e-10 )svp_IC( fit, criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR"), filter_method = c("mixture", "corrected", "particle"), proxy = c("bayes_optimal", "u"), K = 7L, M = 1000L, seed = 42L, del = 1e-10 )
fit |
Output of |
criteria |
Character vector. Subset of
|
filter_method |
Character. Filter method passed to
|
proxy |
Character. Leverage proxy passed to |
K |
Integer. Number of mixture components for
|
M |
Integer. Number of particles for
|
seed |
Integer. Random seed for the bootstrap particle filter. Default 42. Ignored for non-particle filters. |
del |
Numeric. Small constant added inside |
Default criteria (returned by svp_IC(fit)):
BIC_Kalman, AIC_Kalman:
and where is the
(quasi-)log-likelihood from filter_svp; default
filter_method = "mixture" uses the Gaussian mixture
Kalman filter (Kim, Shephard and Chib 1998). BIC_Kalman
is the primary recommended criterion: Schwarz-consistent under
the Bayes-optimal leverage proxy (see proxy argument)
and strong finite-sample performance across the simulation
grid (Ahsan, Dufour and Rodriguez-Rondon 2026).
AIC_Kalman is Shibata-efficient
and often selects larger sooner at .
BIC_HR, AIC_HR: Hannan–Rissanen (1982) two-stage
ARMA() criteria. Stage 1: long-AR pre-whitening at
order produces residuals
. Stage 2: OLS regression of
on AR lags of and MA lags
of gives . Then
. Filter-free anchor, robust to
mis-specification of the GMKF mixture. BIC_HR is
Schwarz-consistent for ARMA() (Hannan & Rissanen
1982; Pötscher 1989).
Opt-in criteria (request via criteria = ...):
AICc_Kalman: AIC_Kalman with the Hurvich–Tsai
(1989) small-sample correction .
Numerically equivalent to AIC_Kalman at ;
use when .
BIC_Whittle: where
is the Whittle log-likelihood evaluated at the
SV() signal-plus-noise spectral density
.
Schwarz-consistent but collapses to in 98–100%
of cells at under near-unit-root
persistence (Ahsan, Dufour and Rodriguez-Rondon 2026). Useful
as a conservative
diagnostic: a Whittle selection of is strong
evidence against .
AIC_YW, BIC_YW: Legacy / not recommended.
Yule–Walker projection-error criteria on
, computed as
with the AR() projection-error variance. Under
SV(), is ARMA() (not AR()),
so the AR projection error does not saturate at
and the criteria are
inconsistent: the AR() projection-error variance
keeps decreasing past , producing
non-monotone (sometimes anti-Schwarz) behaviour in .
Simulation evidence: 0–29% correct selection at
across all DGP cells and
(Ahsan, Dufour and Rodriguez-Rondon
2026). Retained for paper-reproducibility of the
documented failure-case results; use BIC_HR /
AIC_HR for theoretically consistent AR-order selection.
Lower is better; argmin over a grid of candidate p (see
svp_AR_order) selects the AR order.
Named numeric vector of the requested criteria. Lower is better.
Leverage does not affect AIC_YW, BIC_YW, or
BIC_Whittle: under the W-ARMA-SV parameterization
for all three error
distributions (odd-times-even moment symmetry), so the autocovariance
structure of is invariant to the leverage parameter. The
*_HR and *_Kalman criteria do incorporate leverage
through the estimated and the conditional state
innovation variance.
Akaike, H. (1974). A new look at the statistical model identification. IEEE Transactions on Automatic Control 19(6), 716–723. doi:10.1109/TAC.1974.1100705
Schwarz, G. (1978). Estimating the dimension of a model. Annals of Statistics 6(2), 461–464. doi:10.1214/aos/1176344136
Shibata, R. (1976). Selection of the order of an autoregressive model by Akaike's information criterion. Biometrika 63(1), 117–126. doi:10.1093/biomet/63.1.117
Hannan, E. J. (1980). The estimation of the order of an ARMA process. Annals of Statistics 8(5), 1071–1081. doi:10.1214/aos/1176345144
Hannan, E. J., and Rissanen, J. (1982). Recursive estimation of mixed autoregressive-moving average order. Biometrika 69(1), 81–94. doi:10.1093/biomet/69.1.81
Pötscher, B. M. (1989). Model selection under nonstationarity: Autoregressive models and stochastic linear regression models. Annals of Statistics 17(3), 1257–1274. doi:10.1214/aos/1176347267
Whittle, P. (1953). Estimation and information in stationary time series. Arkiv f\"or Matematik 2, 423–434. doi:10.1007/BF02590998
Dunsmuir, W. (1979). A central limit theorem for parameter estimation in stationary vector time series and its application to models for a signal observed with noise. Annals of Statistics 7(3), 490–506. doi:10.1214/aos/1176344671
Hurvich, C. M., and Tsai, C.-L. (1989). Regression and time series model selection in small samples. Biometrika 76(2), 297–307. doi:10.1093/biomet/76.2.297
Kim, S., Shephard, N., and Chib, S. (1998). Stochastic volatility: likelihood inference and comparison with ARCH models. Review of Economic Studies 65(3), 361–393. doi:10.1111/1467-937X.00050
White, H. (1982). Maximum likelihood estimation of misspecified models. Econometrica 50(1), 1–25. doi:10.2307/1912526
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. doi:10.34989/swp-2026-8
set.seed(1) y <- sim_svp(2000, phi = 0.95, sigy = 1, sigv = 0.5)$y fit1 <- svp(y, p = 1) fit2 <- svp(y, p = 2) svp_IC(fit1) svp_IC(fit2)set.seed(1) y <- sim_svp(2000, phi = 0.95, sigy = 1, sigv = 0.5)$y fit1 <- svp(y, p = 1) fit2 <- svp(y, p = 2) svp_IC(fit1) svp_IC(fit2)
Computes standard errors and confidence intervals for estimated parameters
by simulating from the fitted model and re-estimating. Supports all model
types returned by svp: Gaussian (with or without leverage),
Student-t, and GED.
svpSE(object, n_sim = 199, alpha = 0.05, burnin = 500, logNu = FALSE)svpSE(object, n_sim = 199, alpha = 0.05, burnin = 500, logNu = FALSE)
object |
A fitted model object from |
n_sim |
Integer. Number of Monte Carlo replications. Default 199. |
alpha |
Numeric. Significance level for confidence intervals. Default 0.05. |
burnin |
Integer. Burn-in period for simulation. Default 500. |
logNu |
Logical. Solve for |
A list with:
2 x k matrix of confidence intervals (lower, upper).
Standard errors relative to true parameter values.
Standard errors relative to sample mean.
Conservative interval-based standard errors.
Liberal interval-based standard errors.
Matrix of parameter estimates from simulations.
# Gaussian SV(1) y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y fit <- svp(y) se <- svpSE(fit, n_sim = 49) se$CI# Gaussian SV(1) y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y fit <- svp(y) se <- svpSE(fit, n_sim = 49) se$CI