Am 13.07.2022 um 15:06 schrieb Riccardo (Jack) Lucchetti:
On Wed, 13 Jul 2022, Sven Schreiber wrote:
> I cannot answer the first question (anybody out there?),
At the moment, the news impact curve cannot be drawn automatically. It
would be nice if somebody stepped in to write a function package for
doing that.
Not sure if I'm missing something, but the concept of the NIC doesn't
seem so hard, so I'm attaching an attempt of a function that provides
the ingredients for the plot. Please correct me if I misunderstood
what's wanted. Notice that I'm neglecting all ARCH orders beyond 1
because the e^2 in the more distant past are supposed to be zero in the
hypothetical scenario of a shock only occurring in t-1. (As opposed to
the GARCH higher orders, which do contribute.) I hope that's right.
The function only calculates values on a simple discrete grid which can
then be plotted. I'm sure Jack or somebody else could also cook up some
gnuplot code that takes the algebraic quadratic function directly and
plots the theoretical continuous line. (The parameters are returned by
the interim function NICparams.)
Implementing this thing was complicated a little by the fact that the
$model accessor after 'garch' apparently doesn't store the specified p
and q orders, so I had to infer these from the parnames contents (in the
getGARCHorders helper function). It works, but it would be nice if p and
q could be added to the model bundle in the future.
Finally, so far this only works for the native GARCH (including the ARCH
nested case), not for the stuff in the gig package.
cheers
sven