Library: | times |
See also: | genarma |
Quantlet: | genarch | |
Description: | generates a time series e_t=u_t*s_t, where u_t is standard normal distributed and the variances s^2_t follow the GARCH process s^2_t = a_0 + a(B)e^2_t + b(B)s^2_t Here, B denotes the backshift (or lag) operator. You have to deliver the coefficient vectors a and b and the length T of the series e. The sum a(1) + b(1) must be less than one and all coefficients should be non-negative (see the note). |
Usage: | {e,s2} = genarch(a,b,T) | |
Input: | ||
a | vector of the ARCH coefficients (that are a_0 and the coefficients of the lag polynom a(B)) | |
T | integer; length of the generated sample | |
b | vector of GARCH parameters (that are the coefficients of the lag polynom b(B)) | |
Output: | ||
e | (T x 1) vector of the generated time series e_t | |
s2 | (T x 1) vector of the generated variances s^2_t |
library("times") ; loads the quantlets from times library randomize(0) ; sets the seed {e,s2} = genarch(#(2.5,0.1),0.65,5000) acfplot(e^2,12) ; display of the sample acf for e^2_t
Display that shows the sample autocorrelation function of the squared series e^2_t. The first correlation coefficients are significant. It is easy to check that the simple series e_t is uncorrelated.