Page 1 of 1

Mixing Frequency and Missing Value handling in DFModel

Posted: Sun Dec 06, 2015 3:05 pm
by Andaa
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:

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)+um2
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!

Re: Mixing Frequency and Missing Value handling in DFModel

Posted: Thu Dec 10, 2015 4:32 am
by trubador
1) In "Test.prg" there is an "endif" outside the IF statement. You can comment it out as well.
2) It is not clear what you are trying to achieve with the following line: ss_5.append @signal d_GDP = (nrnd)
3) You can use @replace function, if you need to change the values of a series.
4) The two lines below need your attention:

Code: Select all

... ss_5.append @signal d_m2 = c(5)*(s1+s2+s3+s4+s5)+um2+[var=exp(c(43))] ... ss_5.append @state u_m2 = u_m2(-1)+[var=exp(c(43))] ...
um2 should read u_m2 in the former. And note that both equations have the same variance. Make sure this is actually what you want.
5) And keep in mind that such models do not always have to produce feasible results. You can search for possible remedies in the forum, if need be.