You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to specify state disturbance variances for exogeneous regressors in UnobservedComponents (passed by exog parameter). Currently, coefficients of exogeneous parameters can only be computed using least squares (mle_regression=True) or recursive least squares (mle_regression=False).
It would be great to have an option for time-varying regression coefficients. To do this, we need to associate disturbance variables to exogeneous regressors:
It can be done by addining an additional flag (e.g., time_varying_regression) to UnobservedComponents constructor. If the flag is True, regression coefficients are added to the state vector; at the same time, the same number of state disturbances is added (state disturbances are stored in self.parameters_state_cov, if I'm not mistaken). The resulting Kalman filter will be very similar to the one constructed with mle_regression=False. This solution should only require a moderate effort.
Time-varying regression coefficients are briefly mentioned in the section 6.2.1. of Time Series Anaylysis by State Space Methods (J. Durbin, S. J. Koopman).
The text was updated successfully, but these errors were encountered:
This is a design question. We have support for time-varying regression in SARIMAX, but we can't support all variations of all state space models in each model class. The best long-term solution would be to allow composing multiple models together, but we don't have a framework for that yet.
I think it makes sense. I guess two points in favor of adding this option availabe to UnobservedComponents would be:
This option is already available in another model - SARIMAX
This case is fairly common (I can't prove the latter point but pretty much everytime I was using this model I wanted to add some regressors with time-varying coefficients)
In the meanwhile, are there any code examples that would help me to subclass UnobservedComponents to add regressors with time-varying coefficients?
I haven't: I wanted to do it a few times but just never found time. I think the only way would be to tweak the class UnobservedComponents, maybe using implementation of time-varying coefficients in SARIMAX as inspiration.
It is impossible to specify state disturbance variances for exogeneous regressors in
UnobservedComponents
(passed byexog
parameter). Currently, coefficients of exogeneous parameters can only be computed using least squares (mle_regression=True
) or recursive least squares (mle_regression=False
).It would be great to have an option for time-varying regression coefficients. To do this, we need to associate disturbance variables to exogeneous regressors:
It can be done by addining an additional flag (e.g.,
time_varying_regression
) toUnobservedComponents
constructor. If the flag is True, regression coefficients are added to the state vector; at the same time, the same number of state disturbances is added (state disturbances are stored inself.parameters_state_cov
, if I'm not mistaken). The resulting Kalman filter will be very similar to the one constructed withmle_regression=False
. This solution should only require a moderate effort.Time-varying regression coefficients are briefly mentioned in the section 6.2.1. of Time Series Anaylysis by State Space Methods (J. Durbin, S. J. Koopman).
The text was updated successfully, but these errors were encountered: