sample program of logl

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

cwlow48
Posts: 3
Joined: Tue Dec 27, 2011 8:52 am

sample program of logl

Postby cwlow48 » Tue Dec 27, 2011 9:17 am

Hi,

Attached are the sample program of logl which derived from EVIEWS. I slightly modified the program and plugged in my data.
In brief, i used the daily stock indices from 8 countries to calculate the price and volatility spillover.
In EGARCH, it ran pretty well. Problems began to arise in ML.

The error message shows there are missing values in @LOGL series at current coeeficient at observation 47 in "DO_LL1.ML(SHOWOPTS,M=1000,C=1E-5)"

Out of the 8 countries, i managed to run 2 of them in ML. I have tried to alter the initial value but still encountered the similar problem.

Could any one pose a comment on this? Thanks in advance.

PS: attached program do not show problems as i put rklci (or rpse) as the dependent variables. If i put other variables, "missing values" issue pops up.

Sincerely
Attachments
price_volatility.wf1
daily stock index
(235.71 KiB) Downloaded 276 times
egarch1.prg
sample program of EGARCH in eviews
(2.4 KiB) Downloaded 332 times
Last edited by cwlow48 on Tue Dec 27, 2011 9:33 am, edited 2 times in total.

cwlow48
Posts: 3
Joined: Tue Dec 27, 2011 8:52 am

Re: sample program of logl

Postby cwlow48 » Tue Dec 27, 2011 9:22 am

Below is the program which i have modified and there is problem.
as the dependent variable changes, problems occur.

' example program for EViews LogL object
' Estimate EGARCH with generalized error distribution (Nelson's specification)
'
' For discussion, see p. 668 of Hamilton, James D. (1994) Time Series Analysis,
' Princeton University Press.


'change path to data path
%path = @runpath
cd %path

' load workfile
load price_volatility

series rklci = 100*dlog(klci)
series rhkx = 100*dlog(hkx)
series ridx = 100*dlog(idx)
series rpse = 100*dlog(pse)
series rset = 100*dlog(set)
series rsse = 100*dlog(sse)
series rsst = 100*dlog(sst)
series rszse = 100*dlog(szse)

' set sample to 1/1/00-31/12/10 (31/12/10 is obs 2870)
sample s0 2 3
sample s1 4 2870
smpl s1


' get starting values from Gaussian EGARCH
equation eq1
eq1.arch(2,2,asy=2,egarch) ridx c rhkx(-1) ridx(-1) rklci(-1) rpse(-1) rset(-1) rsse(-1) rsst(-1) rszse(-1)
show eq1.output


' declare and initialize parameters

' coefs on lagged variance
coef(2) delta
delta(1) = eq1.c(15)
delta(2) = eq1.c(16)

' coefs on lagged resids
coef(2) alpha
alpha(1) = eq1.c(11)
alpha(2) = eq1.c(12)

' coef on asym term
coef(1) chi
chi(1) = eq1.c(12)/eq1.c(11)

' coefs on deterministic terms
coef(2) rho
rho(1) = 2*log(eq1.@se)
rho(2) = 0

' 0<nu<2 is thick tails; nu>2 is thin tails
coef(1) nu = 2

!pi = @acos(-1)

' set presample values of expressions in logl
smpl s0
series zeta = log(1+rho(2)*ndays)
series h = exp(rho(1))
series z = 0
series temp1 = @abs(z(-1)) + chi(1)*z(-1)


' set up EGARCH likelihood
' note that E|v{t-1}| is absorbed in overall constant rho(1)
logl ll1
ll1.append @logl logl
'zeta = unconditional mean of log(ht)
ll1.append zeta = log(1+rho(2)*ndays)
'log(lambda) p.668 last equation
ll1.append loggam1 = @gammalog(1/nu(1))
ll1.append loglam = -log(2)/nu(1) + 0.5*( loggam1 - @gammalog(3/nu(1)) )
ll1.append temp1 = @abs(z(-1)) + chi(1)*z(-1)
ll1.append log(h) = rho(1) + zeta + delta(1)*(log(h(-1))-zeta(-1)) + delta(2)*(log(h(-2))-zeta(-2)) + alpha(1)*temp1 + alpha(2)*temp1(-1)
ll1.append res = ridx - c(1)*h - c(2) - c(3)*rhkx(-1) - c(4)*ridx(-1) - c(5)*rklci(-1) - c(6)*rpse(-1) - c(7)*rset(-1) - c(8)*rsse(-1) - c(9)*rsst(-1) - c(10)*rszse(-1)
ll1.append z = res/@sqrt(h)
ll1.append logl = log(nu(1)) - loglam - (1+1/nu(1))*log(2) - loggam1 - 0.5*@abs(z/exp(loglam))^nu(1) - 0.5*log(h)


' estimate and display output
smpl s1
ll1.ml(showopts, m=1000, c=1e-5)
show ll1.output

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: sample program of logl

Postby EViews Gareth » Tue Dec 27, 2011 9:53 am

Did you try different starting values?

cwlow48
Posts: 3
Joined: Tue Dec 27, 2011 8:52 am

Re: sample program of logl

Postby cwlow48 » Tue Dec 27, 2011 6:24 pm

Did you try different starting values?
Yes, i did. But the "missing value" problem is still there... Anything else i can do to resolve this?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

sample program of logl

Postby EViews Gareth » Tue Dec 27, 2011 7:56 pm

The only thing you can do is try to track down what is causing the missing value by looking at the constituent parts of the likelihood series and seeing what is causing the NA for that observation.

Ghulam Ali
Posts: 1
Joined: Sat Jan 21, 2012 8:40 am

Re: sample program of logl

Postby Ghulam Ali » Wed Jan 25, 2012 11:20 am

All Friends
I have no experience in programing. I have entered all the commands from program window to command window but i could not find the results of Dcc -garch model. The message which is received at the time of estimation is,"missing values @logl series at current coefficients at observation 1". In logl series data is missing. what is the proper command to estimate logl series. Help me I will be thankful.
Ghulam Ali


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests