but i met some problem when given value to hbar below,
Code: Select all
set lh / = log(hi)
set ll / = log(lo)
set r / = (((lh-ll)**2.0)/(4*log(2)))**0.5
SET Range = log(LH - LL)
SET Ret = LOG(C/C{1})
linreg(NOPRINT) Ret / E
#constant
dofor tau2 = 1 5 20 60 120 240
comp tau1=fix(%max(1,tau2-19))
comp k=0
do i=500,3908-tau2,tau2
comp k=k+1
declare series u
declare series h
nonlin A1 A2 A3 A4
SET H / = EXP(RANGE - 0.43)
SET U / = 0.0
compute A1=1, A2=0.9,A3=0.05,A4=-0.1
frml res = (RANGE - 0.43 - LOG(H))/0.29
frml HF = exp(A1+A2*log(h{1})+A3*u{1} + A4*E{1}/h{1})
frml logl = (h(t)=hf(t)),(u(t)=res(t)),-0.5*u(t)**2/.29**2
maximize(method=BFGS,NOPRINT, iters=10) LOGL i-495 i
do j = tau1,tau2
set H J J = EXP(%BETA(1)*(1-%BETA(2)**j)/(1-%BETA(2))+log(H(I))*%BETA(2)**J)
end do j
stat h tau1 tau2
set hbar k k = %mean
end do i
end dofor tau2
The Error Occurred At Location 684, Line 20 of loop/block
and NO MATTER how i change the code, it always get the same sentence.
please help me with it! many thanks in advance!