
Last chance! 50% off unlimited learning
Sale ends in
ReMeDI tuning parameter function to choose the tuning parameter, kn in ReMeDI estimation
knChooseReMeDI(
pData,
knEqual = FALSE,
knMax = 10,
tol = 0.05,
size = 3,
lower = 2,
upper = 5,
plot = FALSE
)
xts or data.table containing the log-prices of the asset.
Use an altered version of the ReMeDI estimator, where we instead use equal kn, instead of kn and 2*kn for the windows. See Figure 1 of paper in reference section.
max value of kn to be considered
tolerance for the minimizing value. If tol is high, the algorithm will choose a lower optimal value.
size of the local window
lower boundary for the method if it fails to find an optimal value. If this is the case, the best kn between lower and upper is returned
upper boundary for the method if it fails to find an optimal value. If this is the case, the best kn between lower and upper is returned
logical whether to plot the errors.
integer containing the optimal kn
This is the algorithm B.2 in the appendix of the Li and Linton (2019) working paper
A ReMeDI for Microstructure Noise
# NOT RUN {
optimalKn <- knChooseReMeDI(sampleTDataMicroseconds[as.Date(DT) == "2018-01-02",],
knMax = 10, tol = 0.05, size = 3,
lower = 2, upper = 5, plot = TRUE)
optimalKn
# }
# NOT RUN {
# We can also have a much larger search-space
optimalKn <- knChooseReMeDI(sampleTDataMicroseconds[, as.Date(DT) == "2018-01-02"],
knMax = 50, tol = 0.05,
size = 3, lower = 2, upper = 5, plot = TRUE)
optimalKn
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab