Alastair Heggie
2018-08-17 13:23:15 UTC
I have an unobserved components model.
I can specify the steps argument for the forecast method to get 1 to n step
ahead forecasts from the end of the data. I can also use the
get_predictions method to get the one step ahead predictions at all points
in the data.
However, as far as I can see the methods don't allow me to obtain the 1 to
n step ahead forecasts at all time points in the endogenous data. The
result I want would be an [n_observations x n] matrix of forecasts.
Am I correct that the default forecasting methods don't support what I want
to do?
I have found one way to get what I want but it seems very inefficient, I am
hoping someone can suggest a better way:
I can fit the model to obtain the variance parameters. I can then filter
the model n_obs times to the first 1, 2, 3...n_obs data points and eac time
use the forecast method to get the 1-n step ahead forecast.
To avoid having to run the Kalman filter multiple times I have tried to
create a new model for every data point and apply the filtering with the
state initialised using the state estimates from the previous model using
the initialize_known method. However the forecasts obtained from this
method are not correct. As far as I can see the initialize_known method
does not seem to work because nothing changes about the forecasts if I omit
the initialize_known step.
Best wishes,
Alastair
I can specify the steps argument for the forecast method to get 1 to n step
ahead forecasts from the end of the data. I can also use the
get_predictions method to get the one step ahead predictions at all points
in the data.
However, as far as I can see the methods don't allow me to obtain the 1 to
n step ahead forecasts at all time points in the endogenous data. The
result I want would be an [n_observations x n] matrix of forecasts.
Am I correct that the default forecasting methods don't support what I want
to do?
I have found one way to get what I want but it seems very inefficient, I am
hoping someone can suggest a better way:
I can fit the model to obtain the variance parameters. I can then filter
the model n_obs times to the first 1, 2, 3...n_obs data points and eac time
use the forecast method to get the 1-n step ahead forecast.
To avoid having to run the Kalman filter multiple times I have tried to
create a new model for every data point and apply the filtering with the
state initialised using the state estimates from the previous model using
the initialize_known method. However the forecasts obtained from this
method are not correct. As far as I can see the initialize_known method
does not seem to work because nothing changes about the forecasts if I omit
the initialize_known step.
Best wishes,
Alastair