0
votes

I have weekly data with 15 predictor variables for a period of 1 year (52 observations). I plan to compare Prophet forecasting with VAR model.

Is there a way to run cross-validation for these 2 models especially the VAR.

Thanks

HP

1
No response. I guess there is no CROSS VALIDATION fo TIME SERIES DATA>John Doe
Should be moved to CrossValidated StackexchangeArne

1 Answers

1
votes

A good explainer on time series cross validation from the forecasting principles and practice book here

Time series cross-validation is done by splitting training data up to some point in time (typically between 2/3 or 4/5) and using the remainder as validation. Then at each step fit a model to the training data, make an out-of-sample prediction, store that prediction, and add the next data point to your training data.

So at the least step, you're fitting your training model on all of your training data except for a single data point since you'll be comparing that single datapoint to what your model forecasts at this last step. You then can do root mean squared or whatever on the list of predictions you have versus their actual values. In this way, you are testing how appropriately your model can fit this dataset over time.

For Prophet, the docs list an easy way to do it in python.

For VAR, I don't know of an easy way, other than looping over the training data to make forecasts, appending the next timestamp at each step, and then comparing to the validation data.