I am trying to estimate a lstar model (I am attaching the data) using the code:
Code: Select all
calendar(q) 1981:1
allocate 2015:4
open data
data(format=xls,org=obs)
print
nonlin a0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 gamma c
frml glstar = %logistic(gamma*(u{5}-c),1.0)
frml lstar u= g=glstar,a0+(b1*u{1}+b2*u{2}+b3*u{3}+b4*u{4}+b5*u{5}+b6*u{6}+b7*u{7}+b8*u{8})*(1-g)+(b9*u{1}+b10*u{2}+b11*u{3}+b12*u{4}+b13*u{5}+b14*u{6}+b15*u{7}+b16*u{8})*g
stats(fractiles) u
compute ygrid=%seqa(%fract05,(%fract75-%fract25)/49,50)
compute ggrid=%exp(%seqa(log(.25),.1*log(10),8))/(%fract75-%fract25)
nonlin a0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16
compute bestrss=%na
dofor c = ygrid
dofor gamma = ggrid
nlls(noprint,frml=lstar) u 1982:3 2015:4
if .not.%valid(bestrss).or.%rss<bestrss
compute bestrss=%rss,bestc=c,bestgamma=gamma
end dofor gamma
end dofor c
disp "Guess values used" bestc "and" bestgamma
compute c=bestc,gamma=bestgamma
nonlin a0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 gamma c
nlls(frml=lstar) u 1982:3 2015:4
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter A0 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B1 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B2 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B3 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B4 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B5 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B6 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B7 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B8 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B9 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B10 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B11 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B12 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B13 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B14 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B15 Has Not Been Initialized. Trying 0
The Error Occurred At Location 168, Line 3 of loop/block
## NL6. NONLIN Parameter B16 Has Not Been Initialized. Trying 0
Can anyone tell me what is wrong with my code? Also, as you can note the model has two autoregressive parts. Is there any manner to introduce in the code some way to estimate the optimal lag length according to some info criterion?
Best,
Andrea.