Dear Estima Team,
I have the following SS model to estimate;
Y_t = X_t + v_{t+1}
X_t = AX_{t-1} + w_t
where, Y_t is the observable, and X_t is the state variable and I have
a univariate case.
I need to generate the filtered state series, and estimate three
parameters; A, variance of "v" and variance of "w".
Here is my code:
nonlin theta sw sv
compute sv=sw=10.0
compute theta = 0.11
dlm(y=forw_ner, c=1.0, a=theta, sv=sv, sw=sw, method=bfgs,
type=filter, vhat=vhat) / xstates
Here are my two questions;
1) How can I handle the timing difference in the measurement and state equation.
2) How do I declare an initial value for sx0 in dlm? [ I assume x0=0]
Thanks for any feedback.
mhrb
SS-Initial Value and Timing Difference
Re: SS-Initial Value and Timing Difference
1) You can safely ignore that. Since there's no correlation between v and w, there's no difference between this model and the same one with v redated to match w. If you need the vhat's to match the timing that you show, you can shift them after the DLM.mhrb wrote:Dear Estima Team,
I have the following SS model to estimate;
Y_t = X_t + v_{t+1}
X_t = AX_{t-1} + w_t
where, Y_t is the observable, and X_t is the state variable and I have
a univariate case.
I need to generate the filtered state series, and estimate three
parameters; A, variance of "v" and variance of "w".
Here is my code:
nonlin theta sw sv
compute sv=sw=10.0
compute theta = 0.11
dlm(y=forw_ner, c=1.0, a=theta, sv=sv, sw=sw, method=bfgs,
type=filter, vhat=vhat) / xstates
Here are my two questions;
1) How can I handle the timing difference in the measurement and state equation.
2) How do I declare an initial value for sx0 in dlm? [ I assume x0=0]
Thanks for any feedback.
mhrb
2) Use the option presample=ergodic. That will take care of both the x0 (which is zero as you have this written) and the variance.