| Type: | Package |
| Title: | Winsorized ARMA Estimation for Higher-Order Stochastic Volatility Models |
| Version: | 0.3.0 |
| Depends: | R (≥ 3.5.0) |
| 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. The Gaussian-mixture Kalman filter uses precomputed optimal mixture tables (deterministic and fast), with the sampled EM fit and the Kim, Shephard and Chib (1998) table retained as options. 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. |
| License: | GPL (≥ 3) |
| URL: | https://github.com/roga11/wARMASVp |
| BugReports: | https://github.com/roga11/wARMASVp/issues |
| Encoding: | UTF-8 |
| Imports: | Rcpp (≥ 1.0.0), gsignal, stats |
| Suggests: | pso, GenSA, testthat (≥ 3.1.7), knitr, rmarkdown, matrixStats, clue |
| LinkingTo: | Rcpp, RcppArmadillo |
| RoxygenNote: | 7.3.3 |
| VignetteBuilder: | knitr |
| NeedsCompilation: | yes |
| Packaged: | 2026-12-01 14:38:36 UTC; gabrielrodriguez |
| Author: | Gabriel Rodriguez-Rondon
|
| Maintainer: | Gabriel Rodriguez-Rondon <gabriel.rodriguezrondon@mail.mcgill.ca> |
| Repository: | CRAN |
| Date/Publication: | 2026-12-01 23:20:02 UTC |
wARMASVp: Winsorized ARMA Estimation for Higher-Order Stochastic Volatility Models
Description
Estimation, simulation, hypothesis testing, and forecasting for univariate higher-order stochastic volatility SV(p) models. Supports Gaussian, Student-t, and GED innovations with optional leverage effects.
Details
The main user-facing functions are:
-
svp– Estimate SV(p) model with optional leverage -
svpSE– Simulation-based standard errors -
sim_svp– Simulate SV(p) processes -
filter_svp– Kalman/mixture/particle filtering -
forecast_svp– Multi-step volatility forecasts
Author(s)
Maintainer: Gabriel Rodriguez-Rondon gabriel.rodriguezrondon@mail.mcgill.ca (ORCID)
Authors:
Md. Nazmul Ahsan
Jean-Marie Dufour
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. doi:10.1016/j.jeconom.2021.03.008
Ahsan, M. N., Dufour, J.-M., and Rodriguez-Rondon, G. (2025). Estimation and inference for higher-order stochastic volatility models with leverage. Journal of Time Series Analysis, 46(6), 1064-1084. doi:10.1111/jtsa.12851
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
See Also
Useful links:
Add leverage estimation to a fitted SV(p) model (post-processing) Works for all error distributions: Gaussian, Student-t, GED. - Gaussian: closed form (C_F = 1) - Student-t: closed form with C_t(nu) correction - GED: exact 1D root-finding via uniroot + Gauss-Hermite quadrature
Description
Add leverage estimation to a fitted SV(p) model (post-processing) Works for all error distributions: Gaussian, Student-t, GED. - Gaussian: closed form (C_F = 1) - Student-t: closed form with C_t(nu) correction - GED: exact 1D root-finding via uniroot + Gauss-Hermite quadrature
Usage
.add_leverage(out, y, p, rho_type, del, trunc_lev, wDecay, errorType)
Arguments
out |
Model object from .svp_gaussian/.svp_t/.svp_ged (without leverage) |
y |
Numeric vector of observations |
p |
AR order |
rho_type |
"pearson", "kendall", or "both" |
del |
Small constant for log transform |
trunc_lev |
Logical: truncate rho to [-0.99, 0.99] |
wDecay |
Logical: decaying weights (passed from original estimation) |
errorType |
"Gaussian", "Student-t", or "GED" |
Value
Updated model object with leverage fields added
Compute EH cross-moment for leverage estimation
Description
EH = demeaned sample cross-moment (1/(T-2)) \sum(|y_t| - \bar{|y|})(y_{t-1} - \bar{y}).
Usage
.compute_EH(y, rho_type = "pearson")
Arguments
y |
Numeric vector of observations |
rho_type |
"pearson" or "kendall" |
Value
EH value
Gauss-Hermite quadrature nodes and weights for N(0,1) integration Computes nodes z_i and weights w_i such that sum(w_i * f(z_i)) approximates E[f(Z)] where Z ~ N(0,1). Uses the Golub-Welsch algorithm.
Description
Gauss-Hermite quadrature nodes and weights for N(0,1) integration Computes nodes z_i and weights w_i such that sum(w_i * f(z_i)) approximates E[f(Z)] where Z ~ N(0,1). Uses the Golub-Welsch algorithm.
Usage
.gauss_hermite_normal(n = 200L)
Arguments
n |
Number of quadrature points (default 200) |
Value
List with components nodes and weights
Get cached Gauss-Hermite nodes/weights for N(0,1)
Description
Get cached Gauss-Hermite nodes/weights for N(0,1)
Usage
.get_gh(n = 200L)
Arguments
n |
Number of nodes (default 200) |
Value
List with nodes and weights
GMM moments for SVL(p)-GED with fixed A matrix (p+4 conditions) Uses exact GED leverage moment.
Description
GMM moments for SVL(p)-GED with fixed A matrix (p+4 conditions) Uses exact GED leverage moment.
Usage
LRT_moment_lev_ged(y, mdl_out, Amat, rho_type, del = 0)
GMM moments for SVL(p)-GED with HAC weighting (p+4 conditions)
Description
GMM moments for SVL(p)-GED with HAC weighting (p+4 conditions)
Usage
LRT_moment_lev_ged_Amat(y, mdl_out, rho_type, del = 0, Bartlett = TRUE)
GMM moments for SVL(p)-Student-t with fixed A matrix (p+4 conditions)
Description
GMM moments for SVL(p)-Student-t with fixed A matrix (p+4 conditions)
Usage
LRT_moment_lev_t(y, mdl_out, Amat, rho_type, del = 0)
GMM moments for SVL(p)-Student-t with HAC weighting (p+4 conditions)
Description
GMM moments for SVL(p)-Student-t with HAC weighting (p+4 conditions)
Usage
LRT_moment_lev_t_Amat(y, mdl_out, rho_type, del = 0, Bartlett = TRUE)
Construct Companion Matrix for AR(p) Process
Description
Builds the companion matrix representation for an AR(p) process, which is used in the state-space formulation of SV(p) models.
Usage
companionMat(phi, p, q)
Arguments
phi |
Numeric vector of AR coefficients (length p). |
p |
Integer. Order of the AR process. |
q |
Integer. Dimension of each block (typically 1 for univariate). |
Value
A (q*p) x (q*p) companion matrix.
Approximate correction factor C_g(nu) for GED leverage (diagnostic use only)
Description
C_g(\nu) = E[|u|] \cdot \textrm{Cov}(z, F_{GED}^{-1}(\Phi(z))) / \sqrt{2/\pi}.
This is a first-order approximation; estimation uses the exact implicit equation.
Usage
correction_factor_ged_approx(nu, n_nodes = 200L)
Arguments
nu |
GED shape parameter (nu > 0) |
n_nodes |
Number of GH quadrature nodes (default 200) |
Value
Approximate C_g(nu)
Correction factor C_t(nu) for Student-t leverage estimation
Description
Under scale mixture u_t = z_t \lambda_t^{-1/2},
C_t(\nu) = [E[\lambda^{-1/2}]]^2 = (\nu/2) [\Gamma((\nu-1)/2) / \Gamma(\nu/2)]^2.
Exact, parameter-free.
Usage
correction_factor_t(nu)
Arguments
nu |
Degrees of freedom (nu > 1) |
Value
C_t(nu), always > 1 for finite nu (approaches 1 as nu -> Inf)
Density of Centered log-GED^2 Measurement Noise
Description
Density of Centered log-GED^2 Measurement Noise
Usage
density_eps_ged(y, nu)
Arguments
y |
Numeric vector. Evaluation points (centered: E[eps] = 0). |
nu |
Numeric. GED shape parameter. |
Value
Density values.
Density of Centered log-F(1,nu) Measurement Noise (Student-t)
Description
Density of Centered log-F(1,nu) Measurement Noise (Student-t)
Usage
density_eps_t(y, nu)
Arguments
y |
Numeric vector. Evaluation points (centered: E[eps] = 0). |
nu |
Numeric. Student-t degrees of freedom. |
Value
Density values.
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"),
mixture = c("optimal", "ksc", "em"),
K = 7,
M = 1000,
seed = 42,
del = NULL
)
Arguments
object |
An |
method |
Character. Filter method: |
mixture |
Character. Source of the GMKF measurement mixture (only
used when
|
K |
Integer. Number of mixture components for GMKF. Default 7.
Under |
M |
Integer. Number of particles for BPF. Default 1000. |
seed |
Integer. Random seed for BPF and for the sampled EM mixture
( |
del |
Non-negative offset in |
Details
Under leverage (\delta_p \neq 0) the CKF and GMKF prediction step
follows Ahsan, Dufour and Rodriguez-Rondon (2026), Section 3.3.2, eqs.
(48a)-(48b). The state mean is shifted by \sigma_v \delta_p \hat{z}_{t-1}
with \hat{z}_{t-1} = g(\hat{u}_{t-1}), where g(u) = E[z_{t-1} \mid
u_{t-1} = u] is the Bayes-optimal proxy evaluated at the filtered
standardized residual \hat{u}_{t-1} = (y_{t-1}/\sigma_y)
\exp(-\hat{w}_{t-1|t-1}/2), and the prediction covariance is
P_{t|t-1} = A_t P_{t-1|t-1} A_t' + \sigma_v^2 [(1-\delta_p^2) +
\delta_p^2 V_{t-1}]\, r r', \qquad A_t = F - \tfrac{1}{2} \sigma_v \delta_p\,
g'(\hat{u}_{t-1})\, \hat{u}_{t-1}\, r h',
with V_{t-1} = \mathrm{Var}(z_{t-1} \mid u_{t-1} = \hat{u}_{t-1}).
A_t propagates the dependence of the leverage shift on the filtered
state to first order in the state-estimation error, and V_{t-1} is
the mixing-variable variance. By error type: Gaussian g(u) = u,
V = 0; GED g(u) = \Phi^{-1}(F_{GED}(u;\nu)) (eq. 49), V = 0;
Student-t, with c(\nu) = \Gamma((\nu+2)/2)/\Gamma((\nu+1)/2),
g(u) = u \sqrt{2/(\nu+u^2)}\, c(\nu) and
V(u) = u^2 [(\nu+1) - 2 c(\nu)^2]/(\nu+u^2). The GMKF applies the same
step to its collapsed state, and the RTS smoother gain uses A_{t+1}
in place of F. Without leverage both filters are the standard linear
Kalman recursions.
For GED fits with \hat\nu well above 2, in particular at the
estimation boundary \hat\nu = 20 (see nu_boundary on the fit),
the copula map g is extremely steep outside |u| \approx 1.75, so
after an outlying residual A_t is far from stable and the prediction
variance can become very large. The filter remains finite, but the
first-order covariance is not reliable for such fits.
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.
- mixture
(
method = "mixture"only) The measurement mixture actually used: a list withweights,means,vars,nu,distribution.- mixture_source
(
method = "mixture"only) Which mixture source produced it:"optimal","ksc"or"em".
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")
Fit K-Component Gaussian Mixture to Measurement Noise Density
Description
Uses EM algorithm to approximate the measurement noise density with a Gaussian mixture. For Gaussian SV, returns the pre-computed KSC (1998) 7-component table.
Usage
fit_ksc_mixture(
distribution = c("gaussian", "student_t", "ged"),
nu = NULL,
K = 7,
n_sample = 10000,
max_iter = 500,
tol = 1e-08,
seed = 42
)
Arguments
distribution |
Character: |
nu |
Numeric. Shape parameter (ignored for Gaussian). |
K |
Integer. Number of mixture components. Default 7. |
n_sample |
Integer. Sample size for EM fitting. Default 10000. |
max_iter |
Integer. Maximum EM iterations. Default 500. |
tol |
Numeric. Convergence tolerance. Default 1e-8. |
seed |
Integer. Random seed. Default 42. |
Value
List with weights, means, vars, nu,
distribution.
Multi-Step Ahead Volatility Forecast
Description
Applies Kalman filtering/smoothing to an estimated SV(p) model and produces multi-step ahead volatility forecasts with uncertainty quantification.
Usage
forecast_svp(
object,
H = 1,
output = c("log-variance", "variance", "volatility"),
filter_method = "corrected",
mixture = c("optimal", "ksc", "em"),
K = 7,
M = 1000,
seed = 42,
del = NULL
)
Arguments
object |
An |
H |
Integer. Maximum forecast horizon. Default 1. |
output |
Character. Primary output scale: |
filter_method |
Character. Filter method: |
mixture |
Character. Source of the GMKF measurement mixture when
|
K |
Integer. Number of mixture components for GMKF. Default 7.
Under |
M |
Integer. Number of particles for BPF. Default 1000. |
seed |
Integer. Random seed for BPF and the |
del |
Non-negative offset in |
Details
The forecasts follow Ahsan, Dufour and Rodriguez-Rondon (2026), Section
3.3.6. Writing \hat{\xi}_{T|T} and P_{T|T} for the filtered state
and covariance at T (from filter_svp),
\hat{\xi}_{T+h|T} = F^h \hat{\xi}_{T|T} + F^{h-1} r\, \sigma_v \delta_p
\hat{z}_T, \qquad P_{T+h|T} = F P_{T+h-1|T} F' + \sigma_v^2 r r' \ (h \ge 2),
where \hat{z}_T = g(\hat{u}_T) is the Bayes-optimal leverage proxy of
the last filtered residual and P_{T+1|T} is the one-step prediction
covariance of eqs. (48a)-(48b), A_{T+1} P_{T|T} A_{T+1}' + \sigma_v^2
[(1-\delta_p^2) + \delta_p^2 V_T] r r' with A_{T+1} built from
\hat{u}_T (see filter_svp for g, A_t and
V_t). Beyond one step no further leverage shock is observed, so the
full marginal state-innovation variance \sigma_v^2 applies. Without
leverage the recursion is the standard P_{T+h|T} = F P_{T+h-1|T} F' +
\sigma_v^2 r r' at every horizon. For the particle filter
P_{T|T} is the diagonal approximation returned by
filter_svp.
Value
An object of class "svp_forecast", a list containing:
- w_forecasted
Primary forecast (scale determined by
output).- log_var_forecast
Log-volatility forecasts
w_{T+h|T}.- var_forecast
Conditional variance forecasts
\sigma^2_{T+h|T}.- vol_forecast
Conditional volatility forecasts
\sigma_{T+h|T}.- P_forecast
Forecast MSE
P_{T+h|T}for each horizon.- w_estimated
Filtered log-volatility.
- w_smoothed
Smoothed log-volatility.
- zt
Filtered standardized residuals.
- zt_smoothed
Smoothed standardized residuals.
- ys
Demeaned log-squared returns.
- mdl
The estimated model object.
- H
The forecast horizon.
- output
The chosen output scale.
- filter_output
The
"svp_filter"object from filtering.
Examples
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)
E[|u|] for standardized GED(nu) with Var = 1 Closed form: sqrt(Gamma(1/nu)/Gamma(3/nu)) * Gamma(2/nu) / Gamma(1/nu)
Description
E[|u|] for standardized GED(nu) with Var = 1 Closed form: sqrt(Gamma(1/nu)/Gamma(3/nu)) * Gamma(2/nu) / Gamma(1/nu)
Usage
ged_E_abs_u(nu)
Arguments
nu |
GED shape parameter (nu > 0) |
Value
E[|u|]
Access a shipped GMKF mixture table
Description
Returns the precomputed Gaussian-mixture table that
filter_svp (and everything downstream of it) uses when
mixture = "optimal". Each table stores, for every mixture size
K in {7, 10, 12, 16}, the fitted component weights, means and
variances – one mixture for the Gaussian family, and one per \nu
node for GED (200 nodes on [0.1, 20]) and Student-t (500 nodes on
[2.01, 500]). The mixtures approximate the density of the centred
measurement noise \log(z^2) - E[\log(z^2)] and were fitted by
minimising Kullback-Leibler divergence against the exact density
(quadrature, not sampling).
Usage
gmkf_table(family = c("gaussian", "ged", "studentt"))
Arguments
family |
One of |
Details
The returned object carries a "provenance" attribute recording the
md5 of the build script and helpers that produced it; the scripts
themselves ship in system.file("gmkf-tables", package = "wARMASVp")
together with a README describing how to rebuild and verify the tables.
Value
A named list with one entry per mixture size (names "7",
"10", "12", "16"). For "gaussian" each entry
holds vectors w, m, v (and build diagnostics); for
"ged" and "studentt" each entry holds the node grid
nu and matrices w, m, v with one row per
node.
Examples
tab <- gmkf_table("gaussian")
names(tab)
attr(tab, "provenance")
LMC Test for AR Order in SV(p) Models
Description
Performs a Local Monte Carlo (LMC) test of the null hypothesis
H_0: \phi_{p_0+1} = \cdots = \phi_p = 0 (i.e., that an SV(p_0)
model is sufficient against an SV(p) alternative).
Usage
lmc_ar(
y,
p_null,
p_alt,
J = 10,
N = 99,
burnin = 500,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
errorType = "Gaussian",
sigvMethod = "factored",
logNu = TRUE,
winsorize_eps = 0
)
Arguments
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 |
Non-negative offset in |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. |
Amat |
Selects the test statistic. |
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. |
Details
Two test statistics are available.
By default (Amat = NULL and Bartlett = FALSE), the statistic
is Wald-type: S = T \sum_{j=p_0+1}^{p} \hat\phi_j^2, the sum of
squared extra AR coefficients from the fit under the alternative, scaled
by the sample size. The coefficients are not weighted by an estimate of
their covariance matrix. This statistic is non-negative.
With Amat = "Weighted" (or, equivalently, Bartlett = TRUE),
the statistic is LR-type:
S = T \times (M_{H_0} - M_{H_1}), where M denotes the
GMM criterion evaluated at the null and alternative estimates, each with
its own Bartlett kernel HAC weighting matrix. Because the
criteria are moment-based rather than maximized likelihoods, the statistic
may be negative; this indicates evidence in favour of the null, and raises
a warning.
In both cases the p-value is obtained by Monte Carlo simulation under the null.
The null distribution is simulated without leverage. The moment conditions
do not involve the leverage parameter in population (the autocovariances
of \log y_t^2 at lags k \ge 1 do not depend on it); in finite
samples this is an approximation. For Student-t and GED errors,
lmc_ar simulates at the null estimate of the shape parameter
\nu, and mmc_ar searches over \nu.
Value
An object of class "svp_test", a list containing:
- s0
Test statistic from observed data.
- sN
Simulated null distribution (vector of length N).
- pval
Monte Carlo p-value.
- test_type
Character string identifying the test.
- null_param
Name of the parameter(s) tested.
- null_value
Value(s) under the null hypothesis.
- errorType
Error distribution used.
- call
The matched call.
Examples
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)
LMC Test for GED Shape Parameter
Description
Performs a Local Monte Carlo (LMC) test of the null hypothesis
H_0: \nu = \nu_0 for the shape parameter in an SV(p) model
with GED errors. Testing \nu_0 = 2 corresponds to testing normality.
Usage
lmc_ged(
y,
p = 1,
J = 10,
N = 99,
nu_null,
burnin = 500,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
direction = c("two-sided", "less", "greater"),
sigvMethod = "factored",
winsorize_eps = 0
)
Arguments
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 |
Non-negative offset in |
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). |
Value
An object of class "svp_test".
Examples
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)
LMC Test for Leverage in SV(p) Models
Description
Performs a Local Monte Carlo (LMC) test of the null hypothesis
H_0: \rho = \rho_0 (typically \rho_0 = 0, i.e., no leverage)
using a GMM likelihood-ratio type statistic.
Usage
lmc_lev(
y,
p = 1,
J = 10,
N = 99,
rho_null = 0,
burnin = 500,
rho_type = "pearson",
del = 0,
trunc_lev = TRUE,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
errorType = "Gaussian",
logNu = FALSE,
sigvMethod = "factored",
winsorize_eps = 0
)
Arguments
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, |
del |
Non-negative offset in |
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. |
Value
An object of class "svp_test", a list containing:
- s0
Test statistic from observed data.
- sN
Simulated null distribution (vector of length N).
- pval
Monte Carlo p-value.
- test_type
Character string identifying the test.
- null_param
Name of the parameter tested.
- null_value
Value under the null hypothesis.
- call
The matched call.
Examples
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)
LMC Test for Student-t Tail Parameter
Description
Performs a Local Monte Carlo (LMC) test of the null hypothesis
H_0: \nu = \nu_0 for the degrees of freedom parameter in an
SV(p) model with Student-t errors. Testing \nu_0 = \infty
(or a large value) corresponds to testing for normality.
Usage
lmc_t(
y,
p = 1,
J = 10,
N = 99,
nu_null,
burnin = 500,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
logNu = TRUE,
direction = c("two-sided", "less", "greater"),
sigvMethod = "factored",
winsorize_eps = 0
)
Arguments
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 |
Non-negative offset in |
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). |
Value
An object of class "svp_test".
Examples
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)
MMC Test for AR Order in SV(p) Models
Description
Performs a Maximized Monte Carlo (MMC) test of
H_0: \phi_{p_0+1} = \cdots = \phi_p = 0
by maximizing the MC p-value over nuisance parameters
(\phi_1, \ldots, \phi_{p_0}, \sigma_y, \sigma_v, and \nu for
Student-t and GED errors).
Usage
mmc_ar(
y,
p_null,
p_alt,
J = 10,
N = 99,
burnin = 500,
eps = NULL,
threshold = 1,
method = "pso",
maxit = NULL,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
errorType = "Gaussian",
sigvMethod = "factored",
logNu = TRUE,
winsorize_eps = 0,
silence = FALSE
)
Arguments
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 of non-negative half-widths of the search region
around the estimated nuisance parameters. For Gaussian errors it must
have length |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum number of evaluations of the p-value
function by the optimizer (passed as |
del |
Non-negative offset in |
wDecay |
Logical. Use decaying weights. Default |
Bartlett |
Logical. |
Amat |
Selects the test statistic. |
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. |
silence |
Logical. If |
Details
Two test statistics are available.
By default (Amat = NULL and Bartlett = FALSE), the statistic
is Wald-type: S = T \sum_{j=p_0+1}^{p} \hat\phi_j^2, the sum of
squared extra AR coefficients from the fit under the alternative, scaled
by the sample size. The coefficients are not weighted by an estimate of
their covariance matrix. This statistic is non-negative.
With Amat = "Weighted" (or, equivalently, Bartlett = TRUE),
the statistic is LR-type:
S = T \times (M_{H_0} - M_{H_1}), where M denotes the
GMM criterion evaluated at the null and alternative estimates, each with
its own Bartlett kernel HAC weighting matrix. Because the
criteria are moment-based rather than maximized likelihoods, the statistic
may be negative; this indicates evidence in favour of the null, and raises
a warning.
In both cases the p-value is obtained by Monte Carlo simulation under the null.
The null distribution is simulated without leverage. The moment conditions
do not involve the leverage parameter in population (the autocovariances
of \log y_t^2 at lags k \ge 1 do not depend on it); in finite
samples this is an approximation. For Student-t and GED errors,
lmc_ar simulates at the null estimate of the shape parameter
\nu, and mmc_ar searches over \nu.
Value
An object of class "svp_test": the optimizer output with
pval (maximized p-value; also available as value),
par (nuisance parameters at the maximum), s0 (test
statistic from the observed data), N, test_type,
null_param and null_value. Remaining fields depend on the
optimization method; the per-iteration stats of
method = "pso" are returned only when silence = FALSE.
Nuisance parameters
The maximization runs over
(\phi_1,\ldots,\phi_{p_0}, \sigma_y, \sigma_v), and for Student-t and
GED errors also over the shape parameter \nu. \sigma_y is given
a zero half-width by default because the statistic does not depend on the
scale of the data.
In population the moment conditions do not involve \nu. Writing the
linearized model as y^*_t = \log(y_t^2) - \mu = h_t + x_t, with
h_t the AR(p) log-volatility state and x_t an i.i.d.
measurement error independent of h, the autocovariances separate as
\gamma_{y^*}(0) = \gamma_h(0) + \sigma_\varepsilon^2(\nu), \qquad
\gamma_{y^*}(k) = \gamma_h(k) \;\; (k \ge 1),
and the Yule-Walker conditions
m_j = \gamma_{y^*}(p+j) - \sum_{i=1}^{p} \phi_i\,\gamma_{y^*}(p+j-i),
\qquad j = 1,\ldots,p,
use lags k \ge 1 only. In finite samples the distribution of the
statistic can still depend on \nu, through the sampling variability
of the estimated autocovariances, so \nu is searched over. Setting its
half-width to zero holds it at the null estimate.
Examples
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$value
MMC Test for GED Shape Parameter
Description
Performs a Maximized Monte Carlo (MMC) test of H_0: \nu = \nu_0
for the GED shape parameter.
Usage
mmc_ged(
y,
p = 1,
J = 10,
N = 99,
nu_null,
burnin = 500,
eps = NULL,
threshold = 1,
method = "pso",
maxit = NULL,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
direction = c("two-sided", "less", "greater"),
sigvMethod = "factored",
winsorize_eps = 0,
silence = FALSE
)
Arguments
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 of non-negative half-widths of the search region
around the estimated nuisance parameters. Must have length |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum number of evaluations of the p-value
function by the optimizer (passed as |
del |
Non-negative offset in |
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). |
silence |
Logical. If |
Value
An object of class "svp_test": the optimizer output with
pval (maximized p-value; also available as value),
par (nuisance parameters at the maximum), s0 (test
statistic from the observed data), N, test_type,
null_param and null_value. Remaining fields depend on the
optimization method; the per-iteration stats of
method = "pso" are returned only when silence = FALSE.
Examples
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$value
MMC Test for Leverage in SV(p) Models
Description
Performs a Maximized Monte Carlo (MMC) test of the null hypothesis
H_0: \rho = \rho_0 by maximizing the MC p-value over nuisance
parameters (phi, sigma_y, sigma_v).
Usage
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 = 0,
trunc_lev = TRUE,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
errorType = "Gaussian",
logNu = FALSE,
sigvMethod = "factored",
winsorize_eps = 0,
silence = FALSE
)
Arguments
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 of non-negative half-widths 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. Maximum number of evaluations of the p-value
function by the optimizer (passed as |
rho_type |
Character. Correlation type, |
del |
Non-negative offset in |
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. |
silence |
Logical. If |
Value
An object of class "svp_test": the optimizer output with
pval (maximized p-value; also available as value),
par (nuisance parameters at the maximum), s0 (test
statistic from the observed data), N, test_type,
null_param and null_value. Remaining fields depend on the
optimization method; the per-iteration stats of
method = "pso" are returned only when silence = FALSE.
Examples
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$value
MMC Test for Student-t Tail Parameter
Description
Performs a Maximized Monte Carlo (MMC) test of H_0: \nu = \nu_0
by maximizing the MC p-value over nuisance parameters (phi, sigma_y, sigma_v).
Usage
mmc_t(
y,
p = 1,
J = 10,
N = 99,
nu_null,
burnin = 500,
eps = NULL,
threshold = 1,
method = "pso",
maxit = NULL,
del = 0,
wDecay = FALSE,
Bartlett = FALSE,
Amat = NULL,
logNu = TRUE,
direction = c("two-sided", "less", "greater"),
sigvMethod = "factored",
winsorize_eps = 0,
silence = FALSE
)
Arguments
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 of non-negative half-widths of the search region
around the estimated nuisance parameters. Must have length |
threshold |
Numeric. Target p-value. Default 1. |
method |
Character. Optimization method: |
maxit |
Integer. Maximum number of evaluations of the p-value
function by the optimizer (passed as |
del |
Non-negative offset in |
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). |
silence |
Logical. If |
Value
An object of class "svp_test": the optimizer output with
pval (maximized p-value; also available as value),
par (nuisance parameters at the maximum), s0 (test
statistic from the observed data), N, test_type,
null_param and null_value. Remaining fields depend on the
optimization method; the per-iteration stats of
method = "pso" are returned only when silence = FALSE.
Examples
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$value
CDF of Standardized GED
Description
Computes the CDF of the standardized GED(\nu) distribution with
unit variance.
Usage
pged_std(u, nu)
Arguments
u |
Numeric vector. Evaluation points. |
nu |
Numeric. GED shape parameter ( |
Value
Numeric vector of probabilities.
Quantile function for standardized GED(nu) with Var = 1 Uses the relationship between GED CDF and incomplete gamma function.
Description
Quantile function for standardized GED(nu) with Var = 1 Uses the relationship between GED CDF and incomplete gamma function.
Usage
qged_std(p, nu)
Arguments
p |
Probability (0 < p < 1). Clamped to [1e-15, 1-1e-15] internally. |
nu |
GED shape parameter (nu > 0) |
Value
Quantile value
Simulate from a Stochastic Volatility Model
Description
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.
Usage
sim_svp(
n,
phi,
sigy,
sigv,
errorType = "Gaussian",
leverage = FALSE,
rho = 0,
nu = NULL,
burnin = 500
)
Arguments
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. |
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+1} is \rho.
For Student-t errors with leverage, the scale-mixture representation
z_t = \zeta_t \lambda_t^{-1/2} is used, where leverage operates through
the Gaussian component \zeta_t. For GED errors with leverage, a Gaussian
copula construction z_t = F_{\mathrm{GED}}^{-1}(\Phi(\zeta_t)) is used.
In both cases the returned z is the effective return innovation
(not the latent \zeta_t), with marginal distribution matching the
errorType.
Value
A named list of four length-n numeric vectors:
yObserved returns
y_t.hLog-volatility process
w_t(equivalentlyh_t).zReturn innovation such that
y_t = \sigma_y \exp(h_t/2)\, z_t. Marginal distribution matcheserrorType: N(0,1) for Gaussian, t(\nu) for Student-t, unit-variance GED(\nu) for GED.vVolatility innovation such that
h_t - \sum_{j=1}^p \phi_j h_{t-j} = \sigma_v\, v_t. Always N(0,1); under leverage,v_t = \rho\, \zeta_{t-1} + \sqrt{1-\rho^2}\, \epsilon_t.
See Also
svp for estimation.
Examples
# 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")
Solve Discrete Lyapunov Equation
Description
Solves X = F X t(F) + Q for X using the vectorization approach.
Usage
solve_lyapunov_discrete(F_mat, Q)
Arguments
F_mat |
Square matrix. |
Q |
Square matrix (same dimensions as |
Value
Solution matrix X.
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 = 0,
trunc_lev = TRUE,
wDecay = FALSE,
logNu = FALSE,
sigvMethod = "factored",
winsorize_eps = 0,
sigeps = c("theoretical", "estimated")
)
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 |
errorType |
Character. Error distribution: |
rho_type |
Character. Correlation type for leverage estimation. One of
|
del |
Non-negative number. Offset in the 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 or logical. Number of autocovariance lags pooled
in the moment estimate of |
sigeps |
Character, Gaussian errors only. |
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.
- sigeps
Distribution-free moment estimate of
\sigma_\varepsilon, the standard deviation of\varepsilon_t = \log z_t^2(NAif the variance estimate is not positive).- sigeps_nu
The
\sigma_\varepsilonthe fitted model carries intosigv, the filters and the forecasts:\pi/\sqrt{2}for Gaussian errors,\sigma_\varepsilon(\hat\nu)for Student-t and GED.- mubar
E[\log z_t^2]under the fitted model, so thatmu = log(sigy^2) + mubar.- nu_boundary
Student-t and GED only:
TRUEif\hat\nusits at a bound of its search interval, in which casesigeps_nudiffers fromsigeps.NAfor Gaussian errors.- sigeps_method
How
sigeps_nuwas obtained:"theoretical","estimated"(Gaussian) or"nu"(Student-t, GED).- sigeps_fallback
Estimated mode only:
"none", or"pooled"if the single-lag estimate was outside(0, \mathrm{var}(\log y_t^2))and the pooledJ-lag estimate was used instead.- 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. 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
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)
Simulation-Based Standard Errors for SV(p) Models
Description
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.
Usage
svpSE(object, n_sim = 199, alpha = 0.05, burnin = 500, logNu = FALSE)
Arguments
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 |
Value
A list with:
- CI
2 x k matrix of confidence intervals (lower, upper).
- SEsim0
Standard errors relative to true parameter values.
- SEsim
Standard errors relative to sample mean.
- ISEconservative
Conservative interval-based standard errors.
- ISEliberal
Liberal interval-based standard errors.
- thetamat
Matrix of parameter estimates from simulations.
Examples
# 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
AR-order selection sweep for SV(p)
Description
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.
Usage
svp_AR_order(
y,
pmax = 6L,
J = 10L,
leverage = FALSE,
errorType = "Gaussian",
rho_type = "pearson",
del = 0,
trunc_lev = TRUE,
wDecay = FALSE,
logNu = FALSE,
sigvMethod = "factored",
winsorize_eps = 0L,
sigeps = c("theoretical", "estimated"),
filter_method = "mixture",
mixture = c("optimal", "ksc", "em"),
K = 7L,
M = 1000L,
seed = 42L,
criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR")
)
Arguments
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 |
sigeps |
Character, passed to |
filter_method |
Character. Filter method for |
mixture |
Character. Source of the GMKF measurement mixture:
|
K, M, seed |
Filter arguments passed to |
criteria |
Character vector of criteria to compute. Default
returns the four recommended criteria: |
Value
A list with components:
- IC
Numeric matrix, one row per criterion, one column per candidate
pin1:pmax.- argmin
Named integer vector, one entry per criterion, giving the selected
p.NA_integer_if all entries for that criterion areNA.- fits
List of length
pmaxcontaining the fittedsvp()objects (orNULLif a fit failed).
See Also
Examples
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$argmin
Information criteria for SV(p) AR-order selection
Description
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.
Usage
svp_IC(
fit,
criteria = c("BIC_Kalman", "AIC_Kalman", "BIC_HR", "AIC_HR"),
filter_method = c("mixture", "corrected", "particle"),
mixture = c("optimal", "ksc", "em"),
K = 7L,
M = 1000L,
seed = 42L,
del = NULL
)
Arguments
fit |
Output of |
criteria |
Character vector. Subset of
|
filter_method |
Character. Filter method passed to
|
mixture |
Character. Source of the GMKF measurement mixture when
|
K |
Integer. Number of mixture components for
|
M |
Integer. Number of particles for
|
seed |
Integer. Random seed for the bootstrap particle filter and
the |
del |
Non-negative offset in |
Details
Default criteria (returned by svp_IC(fit)):
-
BIC_Kalman,AIC_Kalman:-2\,\hat\ell_K + k\log Tand-2\,\hat\ell_K + 2kwhere\hat\ell_Kis the (quasi-)log-likelihood fromfilter_svp; defaultfilter_method = "mixture"uses the Gaussian mixture Kalman filter (Kim, Shephard and Chib 1998).BIC_Kalmanis the primary recommended criterion: Schwarz-consistent under the Bayes-optimal leverage proxy offilter_svpand strong finite-sample performance across the simulation grid (Ahsan, Dufour and Rodriguez-Rondon 2026).AIC_Kalmanis Shibata-efficient and often selects largerpsooner atp_{\mathrm{true}} \ge 2. -
BIC_HR,AIC_HR: Hannan–Rissanen (1982) two-stage ARMA(p,p) criteria. Stage 1: long-AR pre-whitening at orderL = \lfloor 1.5\, T^{1/3}\rfloorproduces residuals\hat\varepsilon_t. Stage 2: OLS regression ofy_t^*on AR lags1{:}pofy_t^*and MA lags1{:}pof\hat\varepsilon_tgives\hat\sigma_u^2. ThenT_{\mathrm{eff}} \log \hat\sigma_u^2 + \{2(2p{+}1), (2p{+}1)\log T_{\mathrm{eff}}\}. Filter-free anchor, robust to mis-specification of the GMKF mixture.BIC_HRis Schwarz-consistent for ARMA(p,p) (Hannan & Rissanen 1982; Pötscher 1989).
Opt-in criteria (request via criteria = ...):
-
AICc_Kalman:AIC_Kalmanwith the Hurvich–Tsai (1989) small-sample correction2k(k+1)/(T-k-1). Numerically equivalent toAIC_KalmanatT \ge 500; use whenT < 500. -
BIC_Whittle:-2\,\hat\ell_W + k\log Twhere\hat\ell_Wis the Whittle log-likelihood evaluated at the SV(p) signal-plus-noise spectral densityf(\omega) = \sigma_v^2 / |1 - \sum_j \phi_j e^{-ij\omega}|^2 + \sigma_\varepsilon^2(\nu). Schwarz-consistent but collapses to\hat p = 1in 98–100% of cells atp_{\mathrm{true}} \ge 2under near-unit-root persistence (Ahsan, Dufour and Rodriguez-Rondon 2026). Useful as a conservative diagnostic: a Whittle selection ofp > 1is strong evidence againstp = 1. -
AIC_YW,BIC_YW: Legacy / not recommended. Yule–Walker projection-error criteria ony_t^* = \log(y_t^2 + \delta) - \mu, computed asT \log \hat\sigma_{\mathrm{pred}}^2 + \{2k, k\log T\}with the AR(p) projection-error variance. Under SV(p),y_t^*is ARMA(p,p) (not AR(p)), so the AR projection error does not saturate atp_{\mathrm{true}}and the criteria are inconsistent: the AR(p) projection-error variance keeps decreasing pastp_{\mathrm{true}}, producing non-monotone (sometimes anti-Schwarz) behaviour inT. Simulation evidence: 0–29% correct selection atp_{\mathrm{true}} = 2across all DGP cells andT \le 10{,}000(Ahsan, Dufour and Rodriguez-Rondon 2026). Retained for paper-reproducibility of the documented failure-case results; useBIC_HR/AIC_HRfor theoretically consistent AR-order selection.
Lower is better; argmin over a grid of candidate p (see
svp_AR_order) selects the AR order.
Value
Named numeric vector of the requested criteria. Lower is better.
Leverage invariance of non-Kalman criteria
Leverage does not affect AIC_YW, BIC_YW, or
BIC_Whittle: under the W-ARMA-SV parameterization
\mathrm{Cov}(v_t, \varepsilon_{t-1}) = 0 for all three error
distributions (odd-times-even moment symmetry), so the autocovariance
structure of y_t^* is invariant to the leverage parameter. The
*_HR and *_Kalman criteria do incorporate leverage
through the estimated \delta_p and the conditional state
innovation variance.
References
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
See Also
Examples
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)