Description Usage Arguments Details Value Author(s) References Examples
View source: R/highfrequencyGSOC.R
Function returns univariate or multivariate preaveraged estimator, as difined in Hautsch and Podolskij (2013).
1 |
pdata |
a list. Each list-item contains an xts object with the intraday price data of a stock. |
pairwise |
boolean, should be TRUE when refresh times are based on pairs of assets. FALSE by default. |
makePsd |
boolean, in case it is TRUE, the positive definite version of MRC is returned. FALSE by default. |
... |
additional arguments. |
In practice, market microstructure noise leads to a departure from the pure semimartingale model. We consider the process Y in period τ:
\mbox{Y}_{τ} = X_{τ} + ε_{τ}
where, the observed d dimensional log-prices are the sum of underlying Brownian semimartingale process X and a noise term ε_{τ}.
ε_{τ} is an i.i.d process with X.
It is intuitive that under mean zero i.i.d. microstructure noise some form of smoothing of the observed log-price should tend to diminish the impact of the noise. Effectively, we are going to approximate a continuous function by an average of observations of Y in a neighborhood, the noise being averaged away.
Assume there is N equispaced returns in period τ of a list (after refeshing data). Let r_{τ_i} be a return (with i=1, …,N) of an asset in period τ. Assume there is d assets.
In order to define the univariate pre-averaging estimator, we first define the pre-averaged returns as
\bar{r}_{τ_j}^{(k)}= ∑_{h=1}^{k_N-1}g≤ft(\frac{h}{k_N}\right)r_{τ_{j+h}}^{(k)}
where g is a non-zero real-valued function g:[0,1] \rightarrow R given by g(x) = \min(x,1-x). k_N is a sequence of integers satisfying \mbox{k}_{N} = \lfloorθ N^{1/2}\rfloor. We use θ = 0.8 as recommendations in (Hautsch & Podolskij (2013)). The pre-averaged returns are simply a weighted average over the returns in a local window. This averaging diminishes the influence of the noise. The order of the window size k_n is chosen to lead to optimal convergence rates. The pre-averaging estimator is then simply the analogue of the Realized Variance but based on pre-averaged returns and an additional term to remove bias due to noise
\hat{C}= \frac{N^{-1/2}}{θ ψ_2}∑_{i=0}^{N-k_N+1} (\bar{r}_{τ_i})^2-\frac{ψ_1^{k_N}N^{-1}}{2θ^2ψ_2^{k_N}}∑_{i=0}^{N}r_{τ_i}^2
with
ψ_1^{k_N}= k_N ∑_{j=1}^{k_N}≤ft(g≤ft(\frac{j+1}{k_N}\right)-g≤ft(\frac{j}{k_N}\right)\right)^2,\quad
ψ_2^{k_N}= \frac{1}{k_N}∑_{j=1}^{k_N-1}g^2≤ft(\frac{j}{k_N}\right).
ψ_2= \frac{1}{12}
The multivariate counterpart is very similar. The estimator is called the Modulated Realized Covariance (MRC) and is defined as
\mbox{MRC}= \frac{N}{N-k_N+2}\frac{1}{ψ_2k_N}∑_{i=0}^{N-k_N+1}\bar{\boldsymbol{r}}_{τ_i}\cdot \bar{\boldsymbol{r}}'_{τ_i} -\frac{ψ_1^{k_N}}{θ^2ψ_2^{k_N}}\hat{Ψ}
where \hat{Ψ}_N = \frac{1}{2N}∑_{i=1}^N \boldsymbol{r}_{τ_i}(\boldsymbol{r}_{τ_i})'. It is a bias correction to make it consistent. However, due to this correction, the estimator is not ensured PSD. An alternative is to slightly enlarge the bandwidth such that \mbox{k}_{N} = \lfloorθ N^{1/2+δ}\rfloor. δ = 0.1 results in a consistent estimate without the bias correction and a PSD estimate, in which case:
\mbox{MRC}^{δ}= \frac{N}{N-k_N+2}\frac{1}{ψ_2k_N}∑_{i=0}^{N-k_N+1}\bar{\boldsymbol{r}}_i\cdot \bar{\boldsymbol{r}}'_i
an d x d matrix
Giang Nguyen, Jonathan Cornelissen and Kris Boudt
Hautsch, N., & Podolskij, M. (2013). Preaveraging-Based Estimation of Quadratic Variation in the Presence of Noise and Jumps: Theory, Implementation, and Empirical Evidence. Journal of Business & Economic Statistics, 31(2), 165-183.
1 2 3 4 | data(sample_5minprices_jumps)
a= list (sample_5minprices_jumps["2010-01-04",1],
sample_5minprices_jumps["2010-01-04",2] )
MRC(a, pairwise=TRUE,makePsd=TRUE)
|
Loading required package: xts
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
[,1] [,2]
[1,] 0.012927365 0.007313413
[2,] 0.007313413 0.004137426
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.