allocate (# of data points you want)
set(first=0.0) x = x{1}+%ran(sigmaw)
set y = x+%ran(sigmav)all 100
compute sigmav=2.0,sigmaw=1.0
dlm(a=1.0,c=1.0,sv=sigmav^2,sw=sigmaw^2,type=simulate,yhat=yhat)
set y = %scalar(yhat)all 400
*
* This is the ARIMA model (1-L)(1-.4L)y=(1+.3L)u
*
equation(coeffs=||1.4,-.4,.3||,noconstant) arimaeq y 2 1
@armadlm(a=a1,f=f1,c=c1) arimaeq
*
* This is the "airline" SARIMA model (1-L)(1-L^12)y=(1-.7L)(1-.6L^12)u
*
equation(coeffs=||1.0,1.0,-1.0,-.7,-.6,.42||,noconstant,ar=||1,12,13||,ma=||1,12,13||) sarimaeq y
@armadlm(a=a2,f=f2,c=c2) sarimaeq
dlm(a=a1,f=f1,c=c1,yhat=fac1,sw=1.0,type=simulate,presample=ergodic)
dlm(a=a2,f=f2,c=c2,yhat=fac2,sw=4.0,type=simulate,presample=ergodic)
set e1 = %ran(2.0)
set e2 = %ran(0.5)
*
compute p11=1.0,p21=0.5,p22=1.0
*
set y1 = p11*fac1(t)(1)+e1
set y2 = p21*fac1(t)(1)+p22*fac2(t)(1)+e2 mcorozcos wrote:Hello Tom,
I have another question. I want to know, how do I remove the common trend for two series in RATS? I know that exist common trend in the series I need to remove in other to analyze the results.
Thanks for your help
dec vect[series] zt(s-1)
dec frml[vect] cf
do h=1,s/2
set zt(2*h-1) = cos(2*%pi*h*t/s)
if 2*h<=s-1
set zt(2*h) = sin(2*%pi*h*t/s)
end do h
frml cf = %xt(zt,t)Return to State Space Models/DSGE
Users browsing this forum: No registered users and 0 guests