最近做Ender课本第三章第4节中,PPI的GARCH估计
用MLE估计Engle的衰减权重的ARCH(4)模型
自己写的程序如下:
series pi=log(ppi)-log(ppi(-1))
'set sample
sample s1 1960:1 1960:1
sample s2 1960:2 2002:1
smpl s2
' declare coef vectors to use in ARCH likelihood
coef(1) mu = .1
coef(1) alpha = .1
coef(2) beta = .1
coef(1) omega = .1
coef(1) theta=.1
' get starting values from ARMA(1,(1,4))
equation eq_arma.ls pi c pi(-1) ma(1) ma(4)
mu(1) = eq_arma.c(1)
alpha(1)=eq_arma.c(2)
beta(1)=eq_arma.c(3)
beta(2)=eq_arma.c(4)
omega(1)=eq_arma.@se^2
' set presample values of expressions in logl
smpl s1
series sig2=omega(1)
series res=0
' set up ARCH likelihood
logl ll1
ll1.append @logl logl
ll1.append res=pi-mu(1)-alpha(1)*pi(-1)-beta(1)*res(-1)-beta(2)*res(-4)
ll1.append sig2 = omega(1)+theta(1)*(0.4*res(-1)^2+0.3*res(-2)^2+0.2*res(-3)^2+0.1*res(-4)^2)
ll1.append z = res/@sqrt(sig2)
ll1.append logl = log(@dnorm(z)) - log(sig2)/2
' estimate and display results
smpl s2
ll1.ml(showopts, m=1000, c=1e-5)
show ll1.output
在运行后提示:Missing values in @logl series at current coefficients at observation 1960Q2 in "Do_LL1.ml"
百思不得其解
望各位能施以援手,不胜感激,谢谢