garchSpec: Univariate GARCH Time Series Specification

Description Usage Arguments Details Value Author(s) Examples

View source: R/garch-Spec.R

Description

Specifies an univariate GARCH time series model.

Usage

1
2
3
garchSpec(model = list(), presample = NULL, 
    cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd"), 
    rseed = NULL)

Arguments

cond.dist

a character string naming the desired conditional distribution. Valid values are "norm", "ged", "std", "snorm", "sged", "sstd". The default value is the normal distribution.

model

a list of GARCH model parameters:
omega - the constant coefficient of the variance equation, by default 1e-6;
alpha - the value or vector of autoregressive coefficients, by default 0.1, specifying a model of order 1;
beta - the value or vector of variance coefficients, by default 0.8, specifying a model of order 1;
The values for the linear part are:
mu - the mean value, by default NULL;
ar - the autoregressive ARMA coefficients, by default NULL;
ma - the moving average ARMA coefficients, by default NULL.
The parameters for the conditional distributions are:
skew - the skewness parameter (also named "xi"), by default 0.9, effective only for the "dsnorm", the "dsged", and the "dsstd" skewed conditional distributions;
shape - the shape parameter (also named "nu"), by default 2 for the "dged" and "dsged", and by default 4 for the "dstd" and "dsstd" conditional distributions.

Note, the default model=list() specifies Bollerslev's GARCH(1,1) model with normal conditional distributed innovations.

presample

a numeric three column matrix with start values for the series, for the innovations, and for the conditional variances. For an ARMA(m,n)-GARCH(p,q) process the number of rows must be at least max(m,n,p,q)+1, longer presamples are cutted. Note, all presamples are initialized by a normal-GARCH(p,q) process.

rseed

single integer argument, the seed for the intitialization of the random number generator for the innovations. Using the default value rseed=NULL then the random number generation will be started with set.seed(0).

Details

The function garchSpec specifies a GARCH or APARCH time series process which we can use for simulating artificial GARCH and/or APARCH models. This is very useful for testing the GARCH parameter estimation results, since your model parameters are known and well specified.

For example specifying a subet AR(5[1,5])-GARCH(2,1) model with a standardized Student-t distribution with four degrees of freedom will return the following printed output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
        garchSpec(model = list(ar = c(0.5,0,0,0,0.1), alpha =  
            c(0.1, 0.1), beta = 0.75, shape = 4), cond.dist = "std")  
        
        Formula: 
         ~ ar(5) + garch(2, 1)  
        Model: 
         ar:    0.5 0 0 0 0.1  
         omega: 1e-06  
         alpha: 0.1 0.1  
         beta:  0.75  
        Distribution:   
         std  
        Distributional Parameter:  
         nu = 4  
        Presample:  
           time          z     h y  
        0     0 -0.3262334 2e-05 0  
        -1   -1  1.3297993 2e-05 0  
        -2   -2  1.2724293 2e-05 0  
        -3   -3  0.4146414 2e-05 0  
        -4   -4 -1.5399500 2e-05 0  
        

The "Formula" describes the formula expression specifying the generating process, "Model" lists the associated model parameters, "Distribution" the type of the conditional distribution function in use, "Distributional Parmeters" lists the distributional parameter (if any), and the "Presample' shows the presample input matrix.

If we have specified presample=NULL in the argument list, then the presample is generated automatically by default as norm-AR()-GARCH() process.

Value

The returned value is an object of class "fGARCHSPEC".

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## garchSpec -

   # Normal Conditional Distribution:
   spec = garchSpec()
   spec
   
   # Skewed Normal Conditional Distribution:
   spec = garchSpec(model = list(skew = 0.8), cond.dist = "snorm")
   spec
   
   # Skewed GED Conditional Distribution:
   spec = garchSpec(model = list(skew = 0.9, shape = 4.8), cond.dist = "sged")
   spec
   
## More specifications ...

   # Default GARCH(1,1) - uses default parameter settings
   garchSpec(model = list())
   
   # ARCH(2) - use default omega and specify alpha, set beta=0!
   garchSpec(model = list(alpha = c(0.2, 0.4), beta = 0))
   
   # AR(1)-ARCH(2) - use default mu, omega
   garchSpec(model = list(ar = 0.5, alpha = c(0.3, 0.4), beta = 0))
   
   # AR([1,5])-GARCH(1,1) - use default garch values and subset ar[.]
   garchSpec(model = list(mu = 0.001, ar = c(0.5,0,0,0,0.1)))
   
   # ARMA(1,2)-GARCH(1,1) - use default garch values
   garchSpec(model = list(ar = 0.5, ma = c(0.3, -0.3)))  
   
   # GARCH(1,1) - use default omega and specify alpha/beta
   garchSpec(model = list(alpha = 0.2, beta = 0.7))
   
   # GARCH(1,1) - specify omega/alpha/beta
   garchSpec(model = list(omega = 1e-6, alpha = 0.1, beta = 0.8))
   
   # GARCH(1,2) - use default omega and specify alpha[1]/beta[2]
   garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4)))
   
   # GARCH(2,1) - use default omega and specify alpha[2]/beta[1]
   garchSpec(model = list(alpha = c(0.12, 0.04), beta = 0.08))
   
   # snorm-ARCH(1) - use defaults with skew Normal
   garchSpec(model = list(beta = 0, skew = 0.8), cond.dist = "snorm")
   
   # sged-GARCH(1,1) - using defaults with skew GED
   garchSpec(model = list(skew = 0.93, shape = 3), cond.dist = "sged")
   
   # Taylor Schwert GARCH(1,1) - this belongs to the family of APARCH Models
   garchSpec(model = list(delta = 1))
   
   # AR(1)-t-APARCH(2, 1) - a little bit more complex specification ...
   garchSpec(model = list(mu = 1.0e-4, ar = 0.5, omega = 1.0e-6, 
       alpha = c(0.10, 0.05), gamma = c(0, 0), beta = 0.8, delta = 1.8, 
       shape = 4, skew = 0.85), cond.dist = "sstd")

Example output

Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 norm
Presample: 
  time         z     h y
1    0 -1.060003 1e-05 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 snorm
Distributional Parameters: 
 xi = 0.8
Presample: 
  time         z     h y
1    0 0.4994638 1e-05 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 sged
Distributional Parameters: 
 nu = 4.8  xi = 0.9
Presample: 
  time       z     h y
1    0 1.86843 1e-05 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 norm
Presample: 
  time        z     h y
1    0 0.365705 1e-05 0

Formula: 
 ~ arch(2)
Model:
 omega: 1e-06
 alpha: 0.2 0.4
Distribution: 
 norm
Presample: 
  time          z       h y
1   -1  0.9568572 2.5e-06 0
2    0 -1.6669714 2.5e-06 0

Formula: 
 ~ ar(1) + arch(2)
Model:
 ar:    0.5
 omega: 1e-06
 alpha: 0.3 0.4
Distribution: 
 norm
Presample: 
  time          z            h y
1   -1 -0.6549530 3.333333e-06 0
2    0 -0.3865965 3.333333e-06 0

Formula: 
 ~ ar(5) + garch(1, 1)
Model:
 ar:    0.5 0 0 0 0.1
 mu:    0.001
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 norm
Presample: 
  time          z     h      y
1   -4  0.6760132 1e-05 0.0025
2   -3 -0.6561750 1e-05 0.0025
3   -2 -0.3285656 1e-05 0.0025
4   -1  0.3555752 1e-05 0.0025
5    0 -1.1908075 1e-05 0.0025

Formula: 
 ~ arma(1, 2) + garch(1, 1)
Model:
 ar:    0.5
 ma:    0.3 -0.3
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 norm
Presample: 
  time         z     h y
1   -1 1.1450212 1e-05 0
2    0 0.5190121 1e-05 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.2
 beta:  0.7
Distribution: 
 norm
Presample: 
  time           z     h y
1    0 -0.06606649 1e-05 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 norm
Presample: 
  time          z     h y
1    0 0.05921167 1e-05 0

Formula: 
 ~ garch(1, 2)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.4 0.4
Distribution: 
 norm
Presample: 
  time        z     h y
1   -1 1.603313 1e-05 0
2    0 1.688289 1e-05 0

Formula: 
 ~ garch(2, 1)
Model:
 omega: 1e-06
 alpha: 0.12 0.04
 beta:  0.08
Distribution: 
 norm
Presample: 
  time         z            h y
1   -1 1.1357464 1.315789e-06 0
2    0 0.3606295 1.315789e-06 0

Formula: 
 ~ arch(1)
Model:
 omega: 1e-06
 alpha: 0.1
Distribution: 
 snorm
Distributional Parameters: 
 xi = 0.8
Presample: 
  time          z            h y
1    0 -0.9056005 1.111111e-06 0

Formula: 
 ~ garch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
Distribution: 
 sged
Distributional Parameters: 
 nu = 3  xi = 0.93
Presample: 
  time         z     h y
1    0 0.1725305 1e-05 0

Formula: 
 ~ aparch(1, 1)
Model:
 omega: 1e-06
 alpha: 0.1
 beta:  0.8
 delta: 1
Distribution: 
 norm
Presample: 
  time          z     h y
1    0 0.05479666 1e-05 0

Formula: 
 ~ ar(1) + aparch(2, 1)
Model:
 ar:    0.5
 mu:    1e-04
 omega: 1e-06
 alpha: 0.1 0.05
 beta:  0.8
 delta: 1.8
Distribution: 
 sstd
Distributional Parameters: 
 nu = 4  xi = 0.85
Presample: 
  time        z     h     y
1   -1 1.182322 2e-05 2e-04
2    0 1.468289 2e-05 2e-04

fGarch documentation built on May 31, 2017, 4:02 a.m.

Related to garchSpec in fGarch...