%eqnxvector instruction
%eqnxvector instruction
To whom it might concern:
I have estimated the following nonlinear model:
stat(noprint) diflrop
compute scalef=1.0/sqrt(%variance)
lin(define=standard,noprint) diflrop
# diflrop{1}
frml(equation=standard,vector=phi1) phi1f
do i=1,1
compute phi1(i)=%beta(i)
end do
lin(define=transit,noprint) diflrop
# diflrop{1 to 2} diflrop{4} diflrop{6}
frml(equation=transit,vector=phi2) phi2f
do j=1,4
compute phi2(j)=%beta(j)
end do
nonlin(parmset=regparms) phi1 phi2
nonlin(parmset=starparms) gamma
frml flstar = 1/(1+exp(-gamma*scalef*(diflwop{5})))
frml lstar diflwop=f=flstar,phi1f+f*phi2f
compute gamma = 1
nlls(frml=lstar,parmset=regparms+starparms,method=simplex,iters=5) diflrop
nlls(frml=lstar,parmset=regparms+starparms,cvcrit=0.0001) diflrop / resids
then I want to do some misspecification test. For this purpose I need to extract some vectors as follows:
compute standsize=%eqnsize(standard)
compute transize=%eqnsize(transit)
dec rect[series] standreg(2,standsize)
dec rect[series] transreg(2,transize)
dec rect[series] teststand(3,standsize)
dec rect[series] testtrans(3,transize)
do i=1,standsize
set standreg(1,i)=flstar*%eqnxvector(standard,i)
set standreg(2,i)=(1-flstar)*eqnxvector(standard,i)
end do i
bur at this point a message error appears:
Can't Interpret FRML * VECTOR
## SX27. Illegal Combination of Data Types for Operation
>>>>vector(standard,i)<<<<
I can not figure out where is the problem. Help will be very welcome.
Best regards,
Javi
(moderator: edited message title to reflect correct function name)
I have estimated the following nonlinear model:
stat(noprint) diflrop
compute scalef=1.0/sqrt(%variance)
lin(define=standard,noprint) diflrop
# diflrop{1}
frml(equation=standard,vector=phi1) phi1f
do i=1,1
compute phi1(i)=%beta(i)
end do
lin(define=transit,noprint) diflrop
# diflrop{1 to 2} diflrop{4} diflrop{6}
frml(equation=transit,vector=phi2) phi2f
do j=1,4
compute phi2(j)=%beta(j)
end do
nonlin(parmset=regparms) phi1 phi2
nonlin(parmset=starparms) gamma
frml flstar = 1/(1+exp(-gamma*scalef*(diflwop{5})))
frml lstar diflwop=f=flstar,phi1f+f*phi2f
compute gamma = 1
nlls(frml=lstar,parmset=regparms+starparms,method=simplex,iters=5) diflrop
nlls(frml=lstar,parmset=regparms+starparms,cvcrit=0.0001) diflrop / resids
then I want to do some misspecification test. For this purpose I need to extract some vectors as follows:
compute standsize=%eqnsize(standard)
compute transize=%eqnsize(transit)
dec rect[series] standreg(2,standsize)
dec rect[series] transreg(2,transize)
dec rect[series] teststand(3,standsize)
dec rect[series] testtrans(3,transize)
do i=1,standsize
set standreg(1,i)=flstar*%eqnxvector(standard,i)
set standreg(2,i)=(1-flstar)*eqnxvector(standard,i)
end do i
bur at this point a message error appears:
Can't Interpret FRML * VECTOR
## SX27. Illegal Combination of Data Types for Operation
>>>>vector(standard,i)<<<<
I can not figure out where is the problem. Help will be very welcome.
Best regards,
Javi
(moderator: edited message title to reflect correct function name)
Re: %eqnvector instruction
You're missing the space after the target series (and before the =) on the following:Javi wrote:To whom it might concern:
I have estimated the following nonlinear model:
<<snip>>
then I want to do some misspecification test. For this purpose I need to extract some vectors as follows:
compute standsize=%eqnsize(standard)
compute transize=%eqnsize(transit)
dec rect[series] standreg(2,standsize)
dec rect[series] transreg(2,transize)
dec rect[series] teststand(3,standsize)
dec rect[series] testtrans(3,transize)
do i=1,standsize
set standreg(1,i)=flstar*%eqnxvector(standard,i)
set standreg(2,i)=(1-flstar)*eqnxvector(standard,i)
end do i
bur at this point a message error appears:
Can't Interpret FRML * VECTOR
## SX27. Illegal Combination of Data Types for Operation
>>>>vector(standard,i)<<<<
I can not figure out where is the problem. Help will be very welcome.
Best regards,
Javi
Code: Select all
set standreg(1,i) =flstar*%eqnxvector(standard,i)
set standreg(2,i) =(1-flstar)*eqnxvector(standard,i)Re: %eqnvector instruction
Dear Tom:
Thanks for your help. However, after allowing for the spaces
do i=1,standsize
set standreg(1,i) = flstar*%eqnxvector(standard,i)
set standreg(2,i) = (1-flstar)*eqnxvector(standard,i)
end do i
the following error message is obtained:
## SX22. Expected Type REAL, Got MATRIX(REAL) Instead
>>>>vector(standard,i)<<<<
Can I ask for your help once again?
Best regards,
Javi
Thanks for your help. However, after allowing for the spaces
do i=1,standsize
set standreg(1,i) = flstar*%eqnxvector(standard,i)
set standreg(2,i) = (1-flstar)*eqnxvector(standard,i)
end do i
the following error message is obtained:
## SX22. Expected Type REAL, Got MATRIX(REAL) Instead
>>>>vector(standard,i)<<<<
Can I ask for your help once again?
Best regards,
Javi
Re: %eqnxvector instruction
You want to use %eqnxvector(standard,t)(i). %eqnxvector(standard,t) pulls the full k-vector of explanatory variables for equation standard at time t. You then want element i out of that.
Re: %eqnxvector instruction
Thank you very much for your help.
Javi
Javi