I wrote a program to estimate Neural Networks via NLLS, but I get a 'missing values' error message which cannot be because I have no missing values.
I suspect it has something to do with the function I wrote for frml. The below model is a 2 hidden layer that depends on only one lagged value.
Can you please take a look and see where I made a mistake.
Code: Select all
set dsp = log(spp)-log(spp{1})
dec rec param(2,3)
function Neu time n q a0
type integer time
type real a0
com neu=a0
do i=1,q
do j= 1,n
com inner = param(i,2) + param(i,j+2)*dsp(time-j)
end do
com neu = neu + param(i,1)*%logistic(inner,1)
com inner=0
end do
end Neu
nonlin param b0
com b0=%uniform(0.1,20)
com param=%uniform(0.1,20)
frml ANNN = Neu(t,3,2,b0)
nlls(frml=ANNN,method=gauss,iter=150,subiter=100,pmethod=simplex,piters=5,noprint,cvcrit=0.001) dsp 15 255