In modern financial markets, volatility measures the degree of dispersion for assets and plays a crucial role in portfolio allocation, performance evaluation, and risk management. Low-frequency and high-frequency stock data are widely adopted to model the dynamic evolution of daily volatilities, while efforts made for volatility estimation and prediction in the past often employ these two types of data independently. Recent attempts to bridge the gap between these two include the realized GARCH model, the heterogeneous autoregressive (HAR) model, as well as the high-frequency based volatility (HEAVY) model. See Shephard and Sheppard (2010), Hansen, Huang, and Shek (2012), Corsi (2009) for more details.
In addition, Kim and Wang (2016) introduced the unified GARCH-Ito model by embedding the standard GARCH volatility structure in the instantaneous volatilities of an Ito diffusion process. The unified GARCH-Ito model is a continuous-time process at the high-frequency timescale and when restricted to the low-frequency timescale, retains the standard GARCH structure. Moreover, Song et al. (2020) introduced the realized GARCH-Ito model by embedding the realized GARCH model structure in the instantaneous volatilities of a jump-diffusion process. Comparing to the unified GARCH-Ito model, its conditional volatility has integrated volatility and jump variation as innovations, which are high-frequency data-based innovations that are more informative.
The RealizedGARCHIto package aims to provide methods for modeling the high-frequency data with unified GARCH-Ito model and realized GARCH-Ito model. It provides methods to estimate model parameters and allows one to estimate and predict conditional volatilities with the two proposed models. It also includes one sample data set that has low-frequency log returns (return) and realized measures such as realized volatility (RV), bi-power realized volatility (BPV) and jump variation (JV) computed and estimated using the CSI 300 index minute data from 2018-01-01 to 2020-06-30.
Definition The log price Xt, t ∈ ℝ+ obeys the unified GARCH-Ito model if it satisfies where μt is a drift, [t] denotes the integer part of t and when t itself is an integer, [t] = t − 1, Bt is a Brownian motion with respect to a filtration ℱt, σt2 is a volatility process adapted to ℱt, θ = (ω, β, γ) are the model parameters.
Proposition The conditional integrated volatility over the low-frequency period n retains the following iterative structure where τ(θ) = (ωg, βg, γ) are model parameters in the above low-frequency structure and are functions of the original θ, Zn − 1 = Xn − 1 − Xn − 2 is the low-frequency log return. Moreover, The model parameters can be estimated by maximizing the following quasi-maximum likelihood function: where RVi’s are the daily realized volatility estimates. Well-performing realized volatility estimators that can handle the market microstructure noise when frequency of the intraday data is ultra-high include the two-time scale realized volatility estimator, the multi-scale realized volatility estimator, the pre-averaging realized volatility estimator, and the kernel realized volatility estimator. See Ait-Sahalia and Yu (2009), Zhang (2006), Barndorff-Nielsen et al. (2008), Jacod et al. (2009), Christensen, Kinnebrock, and Podolskij (2010) for more details.
To maximize L̂U(θ), we need to specify h1(θ) and we adopt its unconditional expectation such that We estimate the model parameter θ by maximizing L̂U(θ) such that and estimate the model parameter τ(θ) by τ(θ̂).
## Loading required package: GARCHIto
##
## Iter: 1 fn: -5311.7549 Pars: 0.000002193 0.055580680 0.856415209
## Iter: 2 fn: -5311.7549 Pars: 0.000002193 0.055580680 0.856415209
## solnp--> Completed in 2 iterations
## omega_g beta_g gamma
## 2.192972e-06 5.558068e-02 8.564152e-01
Definition The log price Xt, t ∈ ℝ+ obeys the realized GARCH-Ito model if it satisfies \end{equation*} where μt is a drift, [t] denotes the integer part of t and when t itself is an integer, [t] = t − 1, Zt = ∫[t]tdWt, Bt and Wt are standard Brownian motions with respect to filtration ℱt with dWtdBt = ρdt, and σt2 is a volatility process adapted to ℱt. For the jump part, Λt is the standard Poisson process with constant intensity λ and Lt denotes the i.i.d. jump sizes which are independent of the Poisson and continuous diffusion processes. The i.i.d. assumption on jump sizes can be further rewritten as Lt2 = ωL + Mt where Mt’s are i.i.d. random variables with mean zero and constant variance.
Proposition The conditional integrated volatility over the low-frequency period n retains the following iterative structure where τ(θ) = (ωg, αg, βg, γ) are model parameters in the above low-frequency structure and are functions of the original θ. Moreover, The model parameters can be estimated by maximizing the following quasi-maximum likelihood function: where and here RVi’s are the daily realized volatility estimates and JVi’s are the jump variation estimates. Note: in this pacakge, we approximate λωL in ĥ1(θ) by the median of all JVi’s.
We estimate the model parameter θ by maximizing L̂R(θ) such that and estimate the model parameter τ(θ) by τ(θ̂).
##
## Iter: 1 fn: -5340.1082 Pars: 0.000004048 0.554095466 0.376628393
## Iter: 2 fn: -5340.1082 Pars: 0.000004048 0.554095466 0.376628393
## solnp--> Completed in 2 iterations
## omega_g alpha_g gamma
## 4.048457e-06 5.540955e-01 3.766284e-01
##
## Iter: 1 fn: -5340.1052 Pars: 0.000004142 0.557102222 0.000918825 0.371919679
## Iter: 2 fn: -5340.1052 Pars: 0.000004142 0.557102222 0.000918825 0.371919679
## solnp--> Completed in 2 iterations
## omega_g alpha_g beta_g gamma
## 4.142199e-06 5.571022e-01 9.188246e-04 3.719197e-01
plot(model_unified$sigma, cex=0.5, type="o", ylim=c(0,0.00035),
main="estimated conditional volatilities", ylab="", xlab="")
lines(model_realized_NJ$sigma,cex=0.5,type="o",col="blue",lty=2)
lines(model_realized$sigma,cex=0.5,type="o",col="red",lty=3, lwd=0.5)
legend("topleft", cex=0.8,
legend=c("Unified GARCH-Ito", "Realized GARCH-Ito No Jump","Realized GARCH-Ito with Jump"),
col = c("black", "blue", "red"),
lty=c(1,2,3))
The dynamic structure imposed in the unified GARCH-Ito and realized GARCH-Ito model allow us to predict future volatility by estimating the expected conditional integrated volatility, i.e. E[hn + 1(θ)|ℱn], with ĥn + 1(θ̂).
To obtain one-step-ahead estimated value of the conditional volatility, use $pred.
## [1] 3.537240e-05 2.841289e-05 2.843812e-05
To carry out rolling forecast with expanding window, we update the sample size for model construction at each rolling. To evaluate the model performance in volatility forecasting task, we compare ĥn + 1(θ̂) with RVn + 1 and compute the squared prediction error (ĥn + 1(θ̂) − RVn + 1)2.
# conduct out of sample volatility forecasting and compute the mean squared prediction error
error_unified=NULL
error_realized_NJ=NULL
error_realized=NULL
for (i in 560:603){
sink("file")
model1=UnifiedEst(sample_data$BPV[1:i], sample_data$return[1:i])
error_unified=c(error_unified, (model1$pred-sample_data$BPV[i+1])^2)
model2=RealizedEst(sample_data$BPV[1:i])
error_realized_NJ=c(error_realized_NJ, (model2$pred-sample_data$BPV[i+1])^2)
model3=RealizedEst(sample_data$BPV[1:i], sample_data$JV[1:i])
error_realized=c(error_realized, (model3$pred-sample_data$BPV[i+1])^2)
sink()
}
error=c(mean(error_unified), mean(error_realized_NJ), mean(error_realized))
names(error)=c("Unified GARCH-Ito", "Realized GARCH-Ito No Jump", "Realized GARCH-Ito with Jump")
error
## Unified GARCH-Ito Realized GARCH-Ito No Jump
## 4.438905e-10 2.759486e-10
## Realized GARCH-Ito with Jump
## 2.752379e-10
Besides high- and low-frequency stock data, option data provide one more natural source for the more precise forecast of volatilities and have been investigated thoroughly since the seminal work of Black and Scholes (1973). Thus, Song et al. (2020) also discussed how to incorporate additional option data information in parameter estimation. Let NVi’s be the estimated volatility values using option data, assume that NVi and the conditional integrated volatility hi(θ) have the following linear relationship: where b and a are the intercept and slope coefficients, respectively. Moreover, ei’s are martingale differences with mean zero and variance σe2, and they are independent of the price process and the microstructure component.
Let ϕ = (ωg, αg, βg, γ, a, b, σe2), the model parameters can be estimated by maximizing the following quasi-likelihood function,
The homogeneous variance in the linear model can be generalized to heterogeneous variance such as replacing σe2 by σe2hiζ(θ), where ζ > 0 is to adjust the level of heteroscedasticity with ζ = 0 corresponding to the homogeneous case. One may replace σe2 by σe2ĥiζ(θ) in the quasi-likelihood function L̂O(ϕ) and then estimate ζ jointly with the other parameters.
# without the consideration of price jumps
RealizedEst_Option(RV, NV) # homogeneous error
RealizedEst_Option(RV, NV, homogeneous=FALSE ) # heterogeneous error
# with the consideration of price jumps
RealizedEst_Option(RV, JV, NV) # homogeneous error
RealizedEst_Option(RV, JV, NV, homogeneous=FALSE) # heterogeneous error