data.table::setDTthreads(2)
optimalKn <- knChooseReMeDI(sampleTData[as.Date(DT) == "2018-01-02",],
knMax = 10, tol = 0.05, size = 3,
lower = 2, upper = 5, plot = TRUE)
optimalKn
if (FALSE) {
# We can also have a much larger search-space
optimalKn <- knChooseReMeDI(sampleTDataEurope,
knMax = 50, tol = 0.05,
size = 3, lower = 2, upper = 5, plot = TRUE)
optimalKn
}
Run the code above in your browser using DataLab