ARMA-ANN-GARCH model
Posted: Fri Mar 11, 2011 5:24 pm
hi,
I am trying to estimate an ARMA-ANN-ARCH model. The ANN component of the model is defined within a function. When I write the function I get an error message that RATS expects a integer not real, which I donnot know how to get around.
Can you also look at the program to see if I wrote everything correctly. I get the feeling I am not combining the function and the frml command correctly in setting up the ANN component.
thanks.
set dssp = spp-spp{1}
dec vec ARMA(5)
dec vec ANN(2)
dec vec ARCH(3)
com ARMA=%ran(2)
com ANN=%ran(3)
nonlin(paramset=ARMApar) ARMA
nonlin(paramset=ANNpar) ANN
nonlin(paramset=ARCHpar) ARCH
lin(noprint) dssp
# constant dssp{1} dssp{2}
set h = %seesq
set res = 0.0
com ARCH(1) = %seesq ; com ARCH(2) = 0.3 ; com ARCH(3)=0.4
function Neu time
compute Neu=0.0
do i=1,2
com [real]inner = 0.0
do j=1,2
com w1 = sin(%pi*log(2+i+j))
com w2 = sin(%pi*log(5+i+j))
com inner = inner + (w1*dssp(time-j) + w2*dssp(time-j)^2)
## SX22. Expected Type INTEGER, Got REAL Instead
>>>> + (w1*dssp(time-j)<<<<
end do j
compute Neu = Neu + .01*(1+exp(ANN(i)*(inner))^1
end do i
end Neu
frml ANNN = neu(t)
frml mean = ARMA(1) + ARMA(2)*dssp{1} + ARMA(3)*dssp{2} + ARMA(4)*u{1} + ARMA{5}*u{2} + ANNN
frml u = dssp-mean
frml var = ARCH(1) + ARCH(2)*h{1} + ARCH(3)*u{1}^2
frml logly = (u(t)=res(t)),(var(t)=h(t)), %logdensity(h,u)
maximize(parset=ARMApar+ANNpar+ARCHpar) logly 10 *
I am trying to estimate an ARMA-ANN-ARCH model. The ANN component of the model is defined within a function. When I write the function I get an error message that RATS expects a integer not real, which I donnot know how to get around.
Can you also look at the program to see if I wrote everything correctly. I get the feeling I am not combining the function and the frml command correctly in setting up the ANN component.
thanks.
set dssp = spp-spp{1}
dec vec ARMA(5)
dec vec ANN(2)
dec vec ARCH(3)
com ARMA=%ran(2)
com ANN=%ran(3)
nonlin(paramset=ARMApar) ARMA
nonlin(paramset=ANNpar) ANN
nonlin(paramset=ARCHpar) ARCH
lin(noprint) dssp
# constant dssp{1} dssp{2}
set h = %seesq
set res = 0.0
com ARCH(1) = %seesq ; com ARCH(2) = 0.3 ; com ARCH(3)=0.4
function Neu time
compute Neu=0.0
do i=1,2
com [real]inner = 0.0
do j=1,2
com w1 = sin(%pi*log(2+i+j))
com w2 = sin(%pi*log(5+i+j))
com inner = inner + (w1*dssp(time-j) + w2*dssp(time-j)^2)
## SX22. Expected Type INTEGER, Got REAL Instead
>>>> + (w1*dssp(time-j)<<<<
end do j
compute Neu = Neu + .01*(1+exp(ANN(i)*(inner))^1
end do i
end Neu
frml ANNN = neu(t)
frml mean = ARMA(1) + ARMA(2)*dssp{1} + ARMA(3)*dssp{2} + ARMA(4)*u{1} + ARMA{5}*u{2} + ANNN
frml u = dssp-mean
frml var = ARCH(1) + ARCH(2)*h{1} + ARCH(3)*u{1}^2
frml logly = (u(t)=res(t)),(var(t)=h(t)), %logdensity(h,u)
maximize(parset=ARMApar+ANNpar+ARCHpar) logly 10 *