a question on @DISAGGREGATE

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

a question on @DISAGGREGATE

Unread post by hardmann »

Dear Tom:

I want to disaggreate and decompose the quarterly real GDP into monthly trend and cycle components. Therefore, I should deeply understand the detail of @DISAGGREGATE procedure. I begin with the log-linear the option, e.g. MODEL=LOGLIN , and without related series, e.g. n=%eqnsize(xvar) =0, factor=3. In such setting, I can focous on my problem. I do not understand the complicated usage of instruction FRML as follow

if model==2 {
...
if n>0 { ..... }
else {
frml cf = lc=lcf,cv=%zeros(ndlm,1),%do(i,1,factor,%(cv(i)=mx(i)=lc(i)*exp(xstate0(t)(i)))),cv
frml ydistf = exp(xstate0(t)(1))
}
frml yf = %if(.not.observed,%na, %(yadj=y+%dot(cf(t),xstate0(t)),%do(i,1,factor,yadj=yadj-mx(i)),yadj))
}

I learned about Chapter 7 "Interpolation and Distribution" of the state space 2ed e-course, and learned about the principle and application of the extended Kalman filter to linearize the log-linear constraints. I do not understan the first and third instrcution FRML.
Especial, I do not know the usage of equal signs in succession, such as " = lc=lcf " , " %(cv(i)=mx(i)=lc(i)*exp(xstate0(t)(i))) "" .
In addition to, usage of %()function and cv,mx.

Please Tom give the details of usage of these function and instruction.

Best Regard
Hardmann
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

Re: a question on @DISAGGREGATE

Unread post by hardmann »

Dear Tom:

Another question. Due to the type of XSTATE0 is series, the type of XV is rather vector than series. Why? In addtion ,GSET should set series of arrays, I guess the type of XV should be series[vetctor] alikewise of XSTATE0.

Code: Select all

   gset xstate0 startl endl = xv=%zeros(n+ndlm,1), $
 lc=lcf,%do(i,1,factor,xv(i)=%if(lc(i)==0,0.0,log(y*lc(i)))),xv
Best Regard
Hardmann
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: a question on @DISAGGREGATE

Unread post by TomDoan »

The measurement equation has to be linearized around the current expansion point for the state vector, and the state vector has a variable number of states (depends upon the ratio of frequencies, and may also depend upon the noise model). The "mu" for the linearized state space model consists of the function evaluated at the expansion point minus the f'(x0)x0 which is a dot product of two vectors---the individual elements of that are the MX. (This was written to be usable on an earlier version of RATS, so there is no "MU" option used---instead of y=mu+..., it gets transformed to y-mu=...) The MX and CX are VECTORS because they are indexed by the number of states, not by time.
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

Re: a question on @DISAGGREGATE

Unread post by hardmann »

Dear Tom:

Thanks. I eventually figured it out under your suggestion.

hardmann
Post Reply