-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle intercepts in the model #61
Comments
Yes, there are no separate intercept terms in KFAS. What you can do is to add an extra time-invariant (Q=0) state variables C and D to the state vector a, using Another option is to use bssm package which directly supports intercepts (see |
"What you can do is to add an extra time-invariant (Q=0) state variables C and D to the state vector a, using SSMcustom. Then C and D will be estimated "automatically" via Kalman filter." I will try the bssm package. Thank you! |
Ah, yes, but you can also build a bivariate model with common C, D etc and estimate that directly instead of two separate models. |
The length of two series is different, and the Z_t is time-dependent (but is known and different for each series) in my case. Not sure whether it is possible to build one bivariate model. If I build one model, I have to assign many NA's in Z_t for the shorter series. Is it an appropriate way? Can you give some hints? |
Yes if you add NA to the end of shorter y_t then the corresponding value in Z is also ignored. Here is a quick sketch:
|
I see. That is helpful! |
I have a quite standard model but with intercepts:
yt = Z_t * at + C*x + e1_t, where e1_t follows a N(0, H_t),
a_(t+1) = T_t * a_t + D + e2_t, where e2_t follows a N(0, Q_t)
H_t, T_t, Q_t together with two constant intercepts C*x, D are to be fitted. x is a known covariate.
I have two series. For the first one, x = 1; and for the second one, x = 2.
Initially, I tried to build two SSmodels and extract their -loglikelihood and then maximize the sum of two loglikelihood to estimate H_t, T_t, Q_t, C, D. (I want to get the same parameters for two series). However, it seems that in the package, there is no place to put the intercept. Not sure how to deal with that.
Thank you!
The text was updated successfully, but these errors were encountered: