<< garch_grad GARCH models garch_like >>

Grocer >> GARCH models > garch_grad2

garch_grad2

Generates garch gradient

CALLING SEQUENCE

[g,dht,gradt]=garch_grad2(parm,nar,nma,y,x)

PARAMETERS

Input

* parm = vector of parameters (beta, a0, ar and ma in that order)

* nar = # of ar parameters

* nma = # of ma parameters

* y = (n x 1) vector of the endogenous variable

* x = (n x k) vector of the exogenous variables

 

Output

* g = (k+nar+nma+1 x 1) -gradient at param

* dht = (nobs x nar+nma+1) derivative of sigt w.r.t a0, ar, ma

* scores = (k+nar+nma+1 x 1) sub-gradient at each date

DESCRIPTION

Generates garch likelihood gradient. The maximised parameters are the parameters before the transformation that insures the positivity of the variance, whereas garch_gard applies to the true garch parameters, that is the ones obtained after this transformation.

EXAMPLE

load(GROCERDIR+'/data/garchd.dat')
 
bounds('1949q1','1983q4')
r1 = ols('gnpdef','cte','lagts(gnpdef)','lagts(2,gnpdef)','lagts(3,gnpdef)','lagts(4,gnpdef)');
bet = r1('beta');
s = r1('ser');
[y,namey,x]=explouniv('gnpdef',list('cte','lagts(gnpdef)','lagts(2,gnpdef)','lagts(3,gnpdef)','lagts(4,gnpdef)'));
p=[bet ; s ; 0 ; 0 ]
g=garch_grad2(p,1,1,y,x)
 
// the gradient, derivate of sigt and scores have been caluclated at ols solution. Note that the ser is entered since it is squared in garch_gard2 (contrary to garch_grad)

AUTHOR

Eric Dubois 2002

Report an issue
<< garch_grad GARCH models garch_like >>