Page 1 of 1

Neural Networks via NLLS

Posted: Sun Oct 30, 2011 11:42 am
by JohnV
Hi,
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
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points

Re: Neural Networks via NLLS

Posted: Mon Oct 31, 2011 11:06 am
by TomDoan
Your PARAM matrix doesn't match the number of lags that you're using. I would suggest that you make the number of nodes and number of lags into global variables instead of trying to pass them through using the function. That is

compute nnodes=2
compute nlags=3
dec rect param(nnodes,nlags+3)
function Neu time a0
...
use nnodes in place of q and nlags in place of n
...
end Neu