Open MarkusLeyser opened 3 months ago
@m-muecke
@MarkusLeyser cheers for the detailed issue, what you're describing is just a naive and seasonal naive model, i.e. random walk or ARIMA(0,1,0). These methods should already be implemented natively by the forecast package or by the successor the fable package, i.e. forecast::naive(x)
and forecast::snaive(x)
.
Regarding mlr3temporal, the package is currently in an experimental stage and is currently not being actively developed. Hence, there might be some bugs and usage should be seen with caution. There is currently some experimental development in a successor (mlr3forecast), which focus will be on ML forecasting instead. Depending on the progress etc. the aim will be to integrate some native forecasting methods as well, but then I would add the implementation from the fable package and some others instead.
In the mean-time you can achieve the same by using ARIMA(0,1,0) and ARIMA(0,0,0)(0,1,0) for naive and snaive respectively. Lastly, you're welcome of adding PRs, I just can't guarantee of a quick reviews.
Thank you for the quick response (although the package is not currently under active development, as you write). Good to hear that a successor package is planned.
Naive models are exactly what I am referring to above. Given that they can be created using forecast.arima, the benefit of the suggested implementation is quite limited in the first place. It lies mostly in its convenience. (Only some edge cases with limited training data remain unaccounted for with forecast.arima.)
In the light of the future development of mlr3forecast, it might be more valuable to shift my focus to different areas.
Description: I am interested in contributing to the
mlr3temporal
package and would like to propose the addition of a simple "forecast.persistence" learner. (This would be my first contribution to the mlr3 project. 🙂)Motivation and Idea: I am using mlr3 for a benchmarking study on the prediction of photovoltaic power output. In the context of photovoltaics, seasonal persistence prediction is a common (naive) baseline for evaluating forecasting models. This approach uses observations from the latest seasonal cycle for prediction. In contrast, regular persistence prediction would forecast the last available value. For example, in my case, a seasonal persistence prediction would correspond to the photovoltaic power output from 24 hours ago. While this approach looks simple, it can be surprisingly hard to beat.
Both regular and seasonal persistence predictions are valuable baselines for many time series modeling applications. Therefore, I see a benefit in providing a convenient and simple "forecast.persistence" learner in
mlr3temporal
.Implementation: There are two viable options for implementing this simple learner:
Using the
data.table
package:shift()
.Using the
forecast
package:forecast::findfrequency(x)
, which determines the dominant frequency of a time series.forecast.arima
) is already implemented inmlr3temporal
, I personally believe that option 2 is still viable.In both cases, it is necessary to define how the learner behaves when a complete period is not present in the training data, i.e., when the lag order is greater than the length of the data. Hence, the existing forecast.arima learner is not sufficient.
Request: I have attached a few lines of concept code for reference (modified versions of
forecast.arima
andforecast.average, respectively
). I would appreciate it if you could provide feedback on whether such a contribution would be welcomed by the maintainers.Thank you for your time.
LearnerRegrForecastPersistenceShift:
LearnerRegrForecastPersistenceArima:
Example using the included airpassengers task: