View source: R/H_time_series.R
| HTS.predict.knn | R Documentation |
(Beta version) Forecasts a histogram of a time series with the k-nearest
neighbours method, based on the L2 Wasserstein distance: the forecast is the
mean of the histograms following the k histograms most similar to the
one at position.
HTS.predict.knn(HTS, position = length(HTS@data), k = 3)
HTS |
A |
position |
An integer, the position of the last observed histogram (default: the last one). |
k |
The number of neighbours (default 3). |
A distributionH object, the forecast.
Arroyo, J., Mate, C. (2009). Forecasting histogram time series with k-nearest neighbours methods. International Journal of Forecasting, 25(1), 192-207. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ijforecast.2008.07.003")}
prediction <- HTS.predict.knn(HTS = RetHTS, position = 108, k = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.