Writing a Likelihood Function

For questions regarding programming in the EViews programming language.

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

irfanawan1
Posts: 1
Joined: Mon Sep 14, 2015 8:37 pm

Writing a Likelihood Function

Postby irfanawan1 » Wed Sep 16, 2015 6:51 pm

Dear Members,
I have an estimation codes in which Multivariate EGARCH model with dynamic conditional correlation is estimated. These codes were written by some one. I need some clarification in these codes of Likelihood function. The codes are given.

Code: Select all

@LOGL LOGL DOLLAR_E = (DOLLAR - (DOLLAR_ALPHA0(1) + DOLLAR_ALPHA1(1)*DOLLAR(-1) + DOLLAR_ALPHA1(2)*BRENT(-1))) BRENT_S = (BRENT - (DOLLAR_ALPHA0(2) + DOLLAR_ALPHA1(3)*DOLLAR(-1) + DOLLAR_ALPHA1(4)*BRENT(-1))) DOLLAR_Z_E = DOLLAR_E/@SQRT(@VAR(DOLLAR_E)) BRENT_Z_S = BRENT_S/@SQRT(@VAR(BRENT_S)) LOG(DOLLAR_VAR_E) = DOLLAR_BETA0(1) + DOLLAR_BETA1(1)*(ABS(DOLLAR_Z_E(-1))-E_Z+DOLLAR_DELTA(1)*DOLLAR_Z_E(-1)) + DOLLAR_BETA1(2)*(ABS(BRENT_Z_S(-1))-E_Z+DOLLAR_DELTA(2)*BRENT_Z_S(-1)) + DOLLAR_GAMMA1(1)*LOG(DOLLAR_VAR_E(-1))+DOLLAR_DUM(1)*D_DUM1+DOLLAR_DUM(2)*D_DUM2+DOLLAR_DUM(3)*D_DUM3+DOLLAR_DUM(4)*D_DUM4+DOLLAR_DUM(5)*D_DUM5 LOG(BRENT_VAR_S) = DOLLAR_BETA0(2) + DOLLAR_BETA1(3)*(ABS(DOLLAR_Z_E(-1))-E_Z+DOLLAR_DELTA(1)*DOLLAR_Z_E(-1)) + DOLLAR_BETA1(4)*(ABS(BRENT_Z_S(-1))-E_Z+DOLLAR_DELTA(2)*BRENT_Z_S(-1)) + DOLLAR_GAMMA1(2)*LOG(BRENT_VAR_S(-1))+BRENT_DUM(1)*B_SC1+BRENT_DUM(2)*B_SC2+BRENT_DUM(3)*B_SC3+BRENT_DUM(4)*B_SC4+BRENT_DUM(5)*B_SC5 DOLLAR_Z_E = DOLLAR_E/@SQRT(DOLLAR_VAR_E) BRENT_Z_S = BRENT_S/@SQRT(BRENT_VAR_S) DOLLAR_XI = DOLLAR_ETA(1) + DOLLAR_ETA(2)*DOLLAR_Z_E(-1)*BRENT_Z_S(-1) + DOLLAR_ETA(3)*DOLLAR_XI(-1) DOLLAR_COR=2/(1+@EXP(-DOLLAR_XI))-1 DOLLAR_COV=DOLLAR_COR*@SQRT(DOLLAR_VAR_E*BRENT_VAR_S) DOLLAR_DETH = DOLLAR_VAR_E*BRENT_VAR_S - DOLLAR_COV^2 LOGL =-0.5*(2*1*(3387)*LOG(2*@ACOS(-1)) + LOG(DOLLAR_DETH) + (DOLLAR_E^2*BRENT_VAR_S + BRENT_S^2*DOLLAR_VAR_E - 2*DOLLAR_COV*DOLLAR_E*BRENT_S)/DOLLAR_DETH)
When I execute these code the following error
Division by Zero

what should I do to execute these codes.

The complete workfile is attached with this post
Attachments
irfan.wf1
(789.07 KiB) Downloaded 208 times

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests