Learn R Programming

GeneralizedHyperbolic (version 0.8-6)

ghypParam: Parameter Sets for the Generalized Hyperbolic Distribution

Description

These objects store different parameter sets of the generalized hyperbolic distribution as matrices for testing or demonstration purposes.

The parameter sets ghypSmallShape and ghypLargeShape have a constant location parameter of \(\mu\) = 0, and constant scale parameter \(\delta\) = 1. In ghypSmallParam and ghypLargeParam the values of the location and scale parameters vary. In these parameter sets the location parameter \(\mu\) = 0 takes values from {0, 1} and {-1, 0, 1, 2} respectively. For the scale parameter \(\delta\), values are drawn from {1, 5} and {1, 2, 5, 10} respectively.

For the shape parameters \(\alpha\) and \(\beta\) the approach is more complex. The values for these shape parameters were chosen by choosing values of \(\xi\) and \(\chi\) which range over the shape triangle, then the function ghypChangePars was applied to convert them to the \(\alpha, \beta\) parameterization. The resulting \(\alpha, \beta\) values were then rounded to three decimal places. See the examples for the values of \(\xi\) and \(\chi\) for the large parameter sets.

The values of \(\lambda\) are drawn from {-0.5, 0, 1} in ghypSmallShape and {-1, -0.5, 0, 0.5, 1, 2} in ghypLargeShape.

Usage

ghypSmallShape
  ghypLargeShape
  ghypSmallParam
  ghypLargeParam

Arguments

Format

ghypSmallShape: a 22 by 5 matrix; ghypLargeShape: a 90 by 5 matrix; ghypSmallParam: a 84 by 5 matrix; ghypLargeParam: a 1440 by 5 matrix.

Author

David Scott d.scott@auckland.ac.nz

Examples

Run this code
data(ghypParam)
plotShapeTriangle()
xis <- rep(c(0.1,0.3,0.5,0.7,0.9), 1:5)
chis <- c(0,-0.25,0.25,-0.45,0,0.45,-0.65,-0.3,0.3,0.65,
          -0.85,-0.4,0,0.4,0.85)
points(chis, xis, pch = 20, col = "red")


## Testing the accuracy of ghypMean
for (i in 1:nrow(ghypSmallParam)) {
  param <- ghypSmallParam[i, ]
  x <- rghyp(1000, param = param)
  sampleMean <- mean(x)
  funMean <- ghypMean(param = param)
  difference <- abs(sampleMean - funMean)
  print(difference)
}

Run the code above in your browser using DataLab