Library: | times |
See also: | nelmin |
Quantlet: | garchest | |
Description: | estimates a GARCH process with mean zero by QMLE |
Usage: | y = garchest(xx, q, p {, iniest, niniiter}) | |
Input: | ||
xx | n x 1 vector, data | |
q | scalar >= 1, number of lags in the ARCH part | |
p | scalar >= 1, number of lags in the GARCH part | |
iniest | optional (p+q+1) x m matrix, contains initial guesses of estimates; if not supplied, a random starting point is generated | |
niniiter | optional scalar, number of randomly generated starting points (10 by default) | |
Output: | ||
y | list, consisting of components est, stderr, lik, s2 | |
y.est | (p+q+1) x 1 vector, parameter estimates | |
y.stderr | (p+q+1) x 1 vector, standard errors | |
y.lik | scalar, likelihood value | |
y.s2 | n x 1 vector, volatility estimates |
library("times") ; loads the quantlets from times library randomize(0) dax=read("dax") ; monthly DAX 1979:1-2000:10 daxreturn=tdiff(log(dax)) ; generates the monthly return z=garchest(daxreturn,1,1) z.est ; Parameter Estimates z.stderr ; Standard Errors z.lik ; Likelihood dum = timeplot(z{4}, 261) ; Plot of Volatility Estimate
Plots the estimated volatilities and produces the following output: Contents of est [1,] 0.00035762 [2,] 0.1267 [3,] 0.77079 Contents of stderr [1,] 0.00026763 [2,] 0.065286 [3,] 0.11101 Contents of lik [1,] 384.12
library("times") ; loads the quantlets from times library randomize(0) ; Seeding Initial Values x=normal(100) ; Generates normal distributed values z=garchest(x,1,1) z.est ; Parameter Estimates
Contents of est [1,] 0.98828 [2,] 0.03317 [3,] 4.8934e-14