Question about the RESTRICT instruction
Posted: Tue Apr 28, 2015 1:26 am
Hi Tom,
I try to use restrict instruction to test for equality constraints between two coefficients, but RATS keeps reporting mistakes like this:
My code is:
Regards,
Aixia
I try to use restrict instruction to test for equality constraints between two coefficients, but RATS keeps reporting mistakes like this:
Code: Select all
The Error Occurred At Location 1302, Line 39 of loop/block
127231104 Position 157
## X13. Redundant Restrictions. Using 0 Degrees, not 1
Chi-Squared(1)= 0.180709 with Significance Level 0.67076424
The Error Occurred At Location 1434, Line 47 of loop/block
127231104 Position 157
## X13. Redundant Restrictions. Using 0 Degrees, not 1
Chi-Squared(1)= 0.080262 with Significance Level 0.77694329
The Error Occurred At Location 1728, Line 61 of loop/block
127231104 Position 157
## X13. Redundant Restrictions. Using 2 Degrees, not 4
Chi-Squared(2)= 0.626285 or F(2,*)= 0.31314 with Significance Level 0.73114583Code: Select all
OPEN DATA "C:\Users\aixia\Desktop\32 ctrol"
DATA(FORMAT=XLS,ORG=OBS)
CALENDAR(I)
compute gstart=1,gend=%ALLOCEND()
***************
dec vector myresults(32)
do i=1,32
set r1 = %s("s"+i)
*
set r1post = %max(r1,0.0)
set r1negt = %min(r1,0.0)
nonlin b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 a0 a1 a2 a4 nu
compute nu=10.0
stat(NOPRINT) r1
***Setting dummy
set ssmt = t>=2010:03:31
*
set v = %variance
set u = 0.0
frml et = r1-b0-b1*v-(b2*ssmt+b3*(1-ssmt)+(b4*ssmt+b5*(1-ssmt))*v)*r1post{1}-(b6*ssmt+b7*(1-ssmt)+(b8*ssmt+b9*(1-ssmt))*v)*r1negt{1}
frml ht = (1+a4*ssmt)*(a0+a1*u{1}**2+a2*v{1})
***with t distributed errors
frml Lt = (v(t)=ht(t)), (u(t)=et(t)),%LOGTDENSITY(v,u,nu)
linreg(noprint) r1; # constant r1{1}
compute b0=%beta(1), b1=0.0, b2=%beta(2), b3=%beta(2), b4=0.0, b5=0.0, b6=%beta(2), b7=%beta(2), b8=0.0, b9=0.0
compute a0=%seesq, a1=.09781, a2=.83756, a4=0.0
nlpar(subiter=250)
****************
maximize(method=simplex,piters=5,recursive,iterations=6,noprint) Lt 2 *
maximize(method=bfgs,robust,recursive,iter=500) Lt 2 *
***
restrict 1
#3 7
#1.0 -1.0 0.0
restrict 1
#4 8
#1.0 -1.0 0.0
restrict 1
#5 9
#1.0 -1.0 0.0
restrict 1
#6 10
#1.0 -1.0 0.0
restrict 4
#3 7
#1.0 -1.0 0.0
#4 8
#1.0 -1.0 0.0
#5 9
#1.0 -1.0 0.0
#6 10
#1.0 -1.0 0.0
end do i
Aixia