Description
I was wondering if there's a way to create a model and then apply it to new data.
What I'm trying to do is: bootstrap data, create/fit model for a bootstrap, apply that model to original data. At first I thought maybe the new data could be passed in to "forecast" as it is in some other python packages, but I didn't see anything in the docs for that.
I did see that params can be passed in and so I'm wondering if that's the correct approach. How I was visualizing that is: bootstrap data, create/fit model, create/fit a new model and then forecast with that model but pass the original params. This seems a little convoluted since I'm not sure why I'd need to fit the new model conceptually, but since .forecast is a method on .fit and it seems necessary there.
I tried to build up to seeing if the params approach would work, but I'm running into an issue. I'll share the general idea/code here to see if that sheds light on anything obvious, but if not I can create a full example too. Basically I was creating/fitting a model and then forecasting with it (not on other data, just on the same data), which gave me a set of parameters and forecasts. I then re-attempted the forecast and set the params to be the same as the original model, but was getting different forecast values (everything else was kept the same).
Below I'm getting different values for self.fcst and test_fcst:
# Run the model
garch_model = arch_model(self.depen_data, x=self.indep_data, mean=mean, vol="Garch",
p=p, o=o, q=q, power=power, dist=dist)
self.res = garch_model.fit()
params = self.res.params
# create forecast
predict_length = self.horizon + self.lag
self.fcst = self.res.forecast(horizon=predict_length,
method="bootstrap", reindex=False, x=self.fcst_indep_data)
test_fcst = self.res.forecast(params=params, horizon=predict_length,
method="bootstrap", reindex=False, x=self.fcst_indep_data)
So my question is whether either of these approaches (or any other pre-existing approach) is correct and, if the params approach is correct, whether someone has insight on what I'm doing wrong.