I would like to extend snaive
from the forecast
package (or maybe lagwalk
?) and add a custom forecast function custom_snaive
.
I would like it to get as a parameter a list of desired_lags and forecast a simple average of their values. E.g. for hourly data, the following call: custom_snaive(lags=c(24, 48, 24*7))
would return a simple average of the values from 1 day ago, 2 days ago and a week ago.
How would you go about implementing such a function? should I rewrite snaive and use lagwalk? I do not care about prediction intervals currently.
(related to How to create a forecast object in R but simpler)