Mixing Frequency and Missing Value handling in DFModel
Posted: Sun Dec 06, 2015 3:05 pm
Hello,
I'm trying to estimate Dynamic factor model with mixed frequency (monthly and quarterly), following Mariano and Murasawa (2002).
In the model specification my signal equation would be something like below:
My GDP series has an input in every third month of the quarter, otherwise it has NA. What I'm trying to do is, observations which are not available in the series GDP should replaced with draws from Gaussian distribution with parameters equal to original variable estimators. Other variables has a monthly frequency.
But I'm struggling to write the code that can handle the above situation. Especially the if statement gave me an error. Any suggestions would very much appreciated!
Thank you!
I'm trying to estimate Dynamic factor model with mixed frequency (monthly and quarterly), following Mariano and Murasawa (2002).
In the model specification my signal equation would be something like below:
Code: Select all
sspace ss_5
if d_gdp = na then
ss_5.append @signal d_GDP = (nrnd)
else
ss_5.append @signal d_GDP = c(1)*(s1*(1/3)+s2*(2/3)+s3*(1)+s4*(2/3)+s5*(1/3))+(u1*(1/3)+u2*(2/3)+u3*(1)+u4*(2/3)+u5*(1/3)) + [var=exp(c(44))]
endif
ss_5.append @signal d_br = c(3)*(s1+s2+s3+s4+s5)+u_br
ss_5.append @signal d_m = c(4)*(s1+s2+s3+s4+s5)+u_m
ss_5.append @signal d_m2 = c(5)*(s1+s2+s3+s4+s5)+um2But I'm struggling to write the code that can handle the above situation. Especially the if statement gave me an error. Any suggestions would very much appreciated!
Thank you!