ReMeDI {highfrequency} | R Documentation |
ReMeDI
Description
This function estimates the auto-covariance of market-microstructure noise
Let the observed price be given as
, where
is the efficient price and
is the market microstructure noise
The estimator of the 'th lag of the market microstructure is defined as:
where is a tuning parameter. In the function
knChooseReMeDI
, we provide a function to estimate the optimal parameter.
Usage
ReMeDI(pData, kn = 1, lags = 1, makeCorrelation = FALSE)
Arguments
pData |
|
kn |
numeric of length 1 determining the tuning parameter kn this controls the lengths of the non-overlapping interval in the ReMeDI estimation |
lags |
numeric containing integer values indicating the lags for which to estimate the (co)variance |
makeCorrelation |
logical indicating whether to transform the autocovariances into autocorrelations.
The estimate of variance is imprecise and thus, constructing the correlation like this may show correlations that fall outside |
Note
We Thank Merrick Li for contributing his Matlab code for this estimator.
Author(s)
Emil Sjoerup.
References
Li, M. and Linton, O. (2021). A ReMeDI for microstructure noise. Econometrica, forthcoming
Examples
remed <- ReMeDI(sampleTData[as.Date(DT) == "2018-01-02", ], kn = 2, lags = 1:8)
# We can also use the algorithm for choosing the kn tuning parameter
optimalKn <- knChooseReMeDI(sampleTData[as.Date(DT) == "2018-01-02",],
knMax = 10, tol = 0.05, size = 3,
lower = 2, upper = 5, plot = TRUE)
optimalKn
remed <- ReMeDI(sampleTData[as.Date(DT) == "2018-01-02", ], kn = optimalKn, lags = 1:8)