preaverage¶
-
hf.
preaverage
(data, K=None, g=None, return_K=False)[source]¶ The preaveraging scheme of Podolskij and Vetter (2009). It uses the fact that if the noise is i.i.d with zero mean, then averaging a rolling window of (weighted) returns diminishes the effect of microstructure noise on the variance estimate.
- Parameters
- datapd.Series or pd.DataFrame
A time series of log-returns. If multivariate, the time series has to be synchronized (e.g. with
refresh_time()
).- Kint, default =
None
The preaveraging window length.
None
implies \(K=0.4 n^{1/2}\) is chosen as recommended in Hautsch & Podolskij (2013).- gfunction, default =
None
A weighting function.
None
implies \(g(x) = min(x, 1-x)\) is chosen.
- Returns
- data_papd.Series
The preaveraged log-returns.
Notes
The preaveraged log-returns using the window-length \(K\) are given by
\[\begin{equation} \begin{aligned} \bar{\mathbf{Y}}_{i}=\sum_{j=1}^{K-1} g\left(\frac{j}{K}\right) \Delta_{i-j+1}\mathbf{Y}, \quad \text { for } i=K, \ldots, n, \end{aligned} \end{equation}\]where \(\mathbf{Y}_i\) have been synchronized beforehand, for example with
refresh_time()
. Note that the direction of the moving window has been reversed compared to the definition in Podolskij and Vetter (2009) to stay consistent within the package. \(g\) is a weighting function. A popular choice is\[\begin{equation} g(x)=\min (x, 1-x). \end{equation}\]References
Podolskij, M., Vetter, M., 2009. Estimation of volatility functionals in the simultaneous presence of microstructure noise and jumps. Bernoulli 15 (3), 634–658.