News Impact Curve

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

News Impact Curve

Below is an example code for plotting the News Impact Curve (NIC). The code first simulates an EGARCH(1,1) model, and then generates the graph of (a version of) NIC. Main purpose of the code is to give the basic idea behind the NIC and therefore should be modified for more specific cases. And the usual disclaimer applies.

Code: Select all

'News Impact Curve Example for EGARCH(1,1) Model

'Obtaining a feasible curve depends on the significance of parameter values,
'which you may fail to obtain in each run.

'*************************************************************************************
'THIS SECTION SIMULATES AND ESTIMATES AN EGARCH(1,1) MODEL
'*************************************************************************************

'Decide a range and create a workfile
!range = 200
wfcreate u !range

'Assign initial values to series
smpl @first @first
series res = 1
series gar =1
series y = 1

'Simulate an EGARCH(1,1) model
coef(5) theta
theta(1) = 2
theta(2) = .1
theta(3) = .5
theta(4) = .3
theta(5) = .6

for !i=1 to !range-1
smpl !i+1 !i+1
gar = exp(theta(2) + theta(3)*@abs(res(-1)/gar(-1)) + theta(4)*(res(-1)/gar(-1)) + theta(5)*log(gar(-1)))
res = @sqrt(gar)*nrnd
y = theta(1)+res
next

smpl @all
delete gar res

'Estimate the EGARCH(1,1) model with the above generated series
equation eq01.arch(1,1,egarch) y c

'Retrieve residuals, conditional variance and standardized errors
eq01.makeresids res_eq
eq01.makegarch gar_eq
series z = res_eq/@sqrt(gar_eq)

'Replace the estimated coefficent values with the old ones.
for !i=1 to eq01.@ncoef
theta(!i) = eq01.@coef(!i)
next

'*************************************************************************************
'THIS IS THE ACTUAL PART THAT GENERATES THE NEWS IMPACT CURVE
'*************************************************************************************
!uvar = @mean(gar_eq) 'An estimate of unconditional variance
!np = 100 'Number of points
!lb =-2*@round(@max(@abs(z))) 'Lower bound
!ub =2*@round(@max(@abs(z))) 'Upper bound
!s = (!ub-!lb)/(!np-1) 'Step size
matrix(!np,2) nic 'Generate a matrix to store the components

'First observations of standardized error and conditional variance
nic(1,1)=!lb
nic(1,2)=exp(theta(2) + theta(3)*@abs(!lb-!s) + theta(4)*(!lb-!s) + theta(5)*log(!uvar))

'Generate the components, columns being the standardized error and conditional variance, respectively.
for !i=2 to !np
nic(!i,1) = !lb+(!i-1)*!s
nic(!i,2) = exp(theta(2) + theta(3)*@abs(nic(!i-1,1)) + theta(4)*(nic(!i-1,1)) + theta(5)*log(!uvar))
next

'Plot the News Impact Curve (NIC)
nic.xypair

delete gar_eq res_eq z

wonderland6
Posts: 1
Joined: Tue Aug 05, 2014 5:51 pm

Re: News Impact Curve

I'm not that clear with the steps but this is what I do.

1. Estimate the EGARCH model

2. Procs/Make Garch Variance Series, and name it garch01

3. Procs/Make Residual Series (ordinary), and name it resid1

4. Genr z=resid1/sqr (garch01) -- in this case, " resid1" is "u" and garch01 is actually the σ.

5. Use Excel to rearrange the series z from small to large, and name a new series "sig"

6. Command line --- series log(s)=α*abs(sig)-γ*(sig)

7. Open sig and s as a group, and then view-graph- xy line. (I would make the y-axis as conditional volatility instead of conditional variance)

In this way, I always find the positive impact is greater, however, in my EGARCH model, γ is negative and there should be a greater negative impact. Is there something wrong with my steps?

Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 1 guest