nigParam | R Documentation |
These objects store different parameter sets of the normal inverse Gaussian distribution as matrices for testing or demonstration purposes.
The parameter sets nigSmallShape
and
nigLargeShape
have a constant location parameter of
\mu
= 0, and constant scale parameter \delta
=
1. In nigSmallParam
and nigLargeParam
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 nigChangePars
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.
nigSmallShape
nigLargeShape
nigSmallParam
nigLargeParam
nigSmallShape
: a 7 by 4 matrix;
nigLargeShape
: a 15 by 4 matrix;
nigSmallParam
: a 28 by 4 matrix;
nigLargeParam
: a 240 by 4 matrix.
David Scott d.scott@auckland.ac.nz
data(nigParam)
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 nigMean
for (i in 1:nrow(nigSmallParam)) {
param <- nigSmallParam[i, ]
x <- rnig(1000, param = param)
sampleMean <- mean(x)
funMean <- nigMean(param = param)
difference <- abs(sampleMean - funMean)
print(difference)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.