Question about the RESTRICT instruction

Discussions of ARCH, GARCH, and related models
Aixia_Mei
Posts: 29
Joined: Wed Dec 03, 2014 7:16 pm

Question about the RESTRICT instruction

Unread post by Aixia_Mei »

Hi Tom,

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.73114583
My code is:

Code: 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

Regards,
Aixia
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Question about the RESTRICT instruction

Unread post by TomDoan »

What is this supposed to do?

set ssmt = t>=2010:03:31

You have CAL(I), so there is no date mapping to resolve that. Do you have something in the data set to let you determine the date associated with an entry?

(BTW, don't you have zero standard errors in the MAXIMIZE output for some of the parameter estimates---that should have been the first sign that you had a problem).
Aixia_Mei
Posts: 29
Joined: Wed Dec 03, 2014 7:16 pm

Re: Question about the RESTRICT instruction

Unread post by Aixia_Mei »

TomDoan wrote:What is this supposed to do?

set ssmt = t>=2010:03:31

You have CAL(I), so there is no date mapping to resolve that. Do you have something in the data set to let you determine the date associated with an entry?

(BTW, don't you have zero standard errors in the MAXIMIZE output for some of the parameter estimates---that should have been the first sign that you had a problem).
My research aims to investigate the impact of the introduction of short selling on stock returns (volatility and feedback trading), so the event dummy is the introduction day of the regime.

Yes, I get zero standard errors for b2 b4 b6 b8 and a4.

Could you please give me some suggestions about how to solve this problem?
Many thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Question about the RESTRICT instruction

Unread post by TomDoan »

Figure out the entry number that corresponds to the date that you want. Then construct the dummy with

set ssmt = t>=mybreakentry
Aixia_Mei
Posts: 29
Joined: Wed Dec 03, 2014 7:16 pm

Re: Question about the RESTRICT instruction

Unread post by Aixia_Mei »

TomDoan wrote:Figure out the entry number that corresponds to the date that you want. Then construct the dummy with

set ssmt = t>=mybreakentry

Thanks a lot Tom, the problem is solved.
Post Reply