How to display a formula ?
Questions are in the brackets included in the code.
Thanks in advance.
Code: Select all
* Same model estimated using MAXIMIZE
*
linreg dlogdm
# constant dlogdm{1}
frml(lastreg,vector=beta) meanf
nonlin(parmset=meanparms) beta (Without followed by a MAXIMIZE NLLS or DLM, this is [i]only[/i] for assigning parameter values (BETA(1) BETA(2) here) to MEANPARMS defined in PARMSET?)
*
set uu = %seesq
set h = %seesq
set u = 0.0
*
nonlin(parmset=garchparms) c a b
compute c=%seesq,a=.05,b=.05
frml varf = c+a*uu{1}+b*h{1}
frml logl = (u=dlogdm-meanf),(uu(t)=u**2),(h(t)=varf(t)),%logdensity(h,u)
(Q1: dlogdm-meanf is calculated once (per individual/per evaluation) as said in RM for FRML. This means for each t, dlogdm-meanf is calculated and assigned to u(SERIES), then used to calculate each uu(t). It seems that if I remove (t), then it still functions well "frml logl = (u=dlogdm-meanf),(uu=u**2),(h=varf),%logdensity(h,u) " So the question is that WHERE (t) is compulsory?)
(Q2: Is this the way to calculate sigma_square recursively, how the likelihood function is summed up? In RM, %logdensity is said to use h as Symmetric and u as Vector, but they seem to be series here. )
maximize(parmset=meanparms+garchparms) logl 3 * ( It seems that MAXIMIZE function has an option called RECURSIVE, but I did not find it in RM7.0.How is that used? Like the code(From TSAY's textbook) I listed as following )
Code: Select all
all 0 792:1
open data sp500.txt
data(org=obs) / rt
set h = 0.0
nonlin mu a0 a1 b1
frml at = rt(t)-mu
frml gvar = a0+a1*at(t-1)**2+b1*h(t-1)
frml garchln = -0.5*log(h(t)=gvar(t))-0.5*at(t)**2/h(t)
smpl 2 792
compute a0 = 0.01,a1 = 0.1,b1 = 0.5,mu = 0.1
maximize(method=bhhh,recursive,iterations=150) garchln