estimate_parameters: Estimate parameters for the stochastic volatility model

View source: R/optSV.R

estimate_parametersR Documentation

Estimate parameters for the stochastic volatility model

Description

Estimate parameters of a stochastic volatility model with a latent log-volatility following an autoregressive process of order one with normally distributed noise. The following distributions are implemented for the observed process:

  • "gaussian": Gaussian distribution.

  • "t": t-distribution, scaled to unit variance. Estimates the degrees of freedom df.

  • "leverage": Gaussian distribution where the noise of the latent process is correlated with the observational noise. Estimates the correlation rho.

  • "skew_gaussian": Skew gaussian distribution with mean zero and unit variance. Estimates the skewness of the observational noise.

  • "skew_gaussian_leverage": Skew gaussian distribution with leverage. The skew gaussian return shock z_t drives the volatility shock, eta_t = rho * z_t + sqrt(1 - rho^2) * e_t, where e_t is standard gaussian. Estimates both the skewness and rho.

  • "skew_t": Skew t distribution of Jones and Faddy (2003), scaled to mean zero and unit variance. The left and the right tail have their own degrees of freedom, df_left and df_right, so the model can have heavier tails for losses than for gains. With equal values it is the "t" model.

  • "skew_t_leverage": Skew t distribution with leverage. As in "skew_gaussian_leverage", the return shock z_t drives the volatility shock, eta_t = rho * z_t + sqrt(1 - rho^2) * e_t. Estimates df_left, df_right and rho.

The parameters is estimated by minimizing the negative log-likelihood (nll) and the latent log-volatility is integrated out by applying the Laplace approximation.

Usage

estimate_parameters(data, model = "gaussian", opt.control = NULL, ...)

Arguments

data

A vector of observations.

model

A character specifying the model. Must be one of the following: "gaussian", "t", "leverage", "skew_gaussian", "skew_gaussian_leverage", "skew_t", "skew_t_leverage".

opt.control

An optional list of parameters for nlminb.

...

additional arguments passed to MakeADFun.

Value

Object of class stochvolTMB

Skew gaussian models

The skew gaussian models report two numbers for the asymmetry of the standardized noise z:

  • alpha: the shape parameter of the skew normal density. alpha = 0 gives the gaussian distribution and alpha -> Inf the half-gaussian distribution. It has no direct statistical meaning.

  • skewness: the skewness E[z^3] of the noise, a monotone function of alpha. With delta = alpha / sqrt(1 + alpha^2) and mu = delta * sqrt(2 / pi), skewness = (4 - pi) / 2 * mu^3 / (1 - mu^2)^(3 / 2). For example, alpha = 0.5, 1, 2 and 5 give skewness = 0.02, 0.14, 0.45 and 0.85.

The models estimate the skewness, not alpha. Close to zero the skewness grows like alpha^3, so the likelihood is flat in alpha at alpha = 0 and the optimizer does not move from there.

Use summary(object, report = "transformed") to get skewness and alpha with standard errors. Use skewness for inference. Use alpha when you need the shape parameter, for example in sim_sv or sn::dsn. Close to zero skewness, alpha changes fast with the skewness, so the standard error of alpha is very large even when the skewness is well determined. In the "skew_gaussian_leverage" model the skewness is that of the return shock, not of the returns.

Skew t models

The left tail of the noise decays like a Student t distribution with df_left degrees of freedom and the right tail like one with df_right degrees of freedom. A smaller value means a heavier tail. If df_left < df_right, large losses are more likely than large gains of the same size, and the noise is skewed to the left. Both values are greater than 2, so that the variance exists. They are estimated on the scale log(df - 2).

A light tail is hard to tell apart from a gaussian tail. If one tail is light, its estimated degrees of freedom can be very large and have a large standard error, and nlminb can report false convergence. This means that the data show no heavy tail on that side. The same is true for df in the "t" model. In both models the degrees of freedom are capped at 10,000, because the density cannot be calculated accurately for larger values. Short series (a few hundred observations) can also confuse heavy tails with a very noisy log-volatility.

Hansen's (1994) skewed t distribution is not used, because its log density has a jump in the second derivative at the mode. This makes the Laplace approximation inaccurate and the optimization unstable.

References

Jones, M. C. and Faddy, M. J. (2003). A skew extension of the t-distribution, with applications. Journal of the Royal Statistical Society: Series B, 65(1), 159-174. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1467-9868.00378")}

Examples


# load data
data("spy")

# estimate parameters 
opt <- estimate_parameters(spy$log_return, model = "gaussian")

# get parameter estimates with standard error
estimates <- summary(opt)

# plot estimated volatility with 95 % confidence interval
plot(opt, include_ci = TRUE)

# skew gaussian model with leverage
opt_sgl <- estimate_parameters(spy$log_return, model = "skew_gaussian_leverage", silent = TRUE)
summary(opt_sgl, report = "transformed")


stochvolTMB documentation built on Nov. 7, 2026, 5:08 p.m.