I have a time series training dataset from the period 2010-2016 with the number of observations listed in the table below. I want to perform rolling origin cross-validation in R, where the initial fold uses the observations from 2010 as training and 2011 as testing. The second fold uses daa from 2010 and 2011 as training and 2012 as testing etc.
I have tried different functions such as rolling_origin
and carets trainControl
but sadly it seems only to work with 1 forecast horizon value and 1 skip value. I deeply appreciate any help, especially code example!
2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 |
---|---|---|---|---|---|---|
614 | 617 | 599 | 677 | 881 | 1215 | 1208 |