Last data update: 2014.03.03

R: Parameter Sets for the Generalized Inverse Gaussian...
gigParamR Documentation

Parameter Sets for the Generalized Inverse Gaussian Distribution

Description

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

The parameter sets gigSmallParam and gigLargeParam give combinations of values of the parameters chi, psi and lambda. For gigSmallParam, the values of chi and psi are chosen from {0.1, 0.5, 2, 5, 20, 50}, and the values of lambda from {-0.5, 0, 0.5, 1, 5}. For gigLargeParam, the values of chi and psi are chosen from {0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100}, and the values of lambda from {-2, -1, -0.5, 0, 0.1, 0.2, 0.5, 1, 2, 5, 10}.

Usage

  gigSmallParam
  gigLargeParam

Format

gigSmallParam: a 125 by 3 matrix; gigLargeParam: a 1100 by 3 matrix.

Author(s)

David Scott d.scott@auckland.ac.nz

Examples

data(gigParam)
## Check values of chi and psi
plot(gigLargeParam[, 1], gigLargeParam[, 2])
### Check all three parameters
pairs(gigLargeParam,
  labels = c(expression(chi),expression(psi),expression(lambda)))

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeneralizedHyperbolic)
Loading required package: DistributionUtils
Loading required package: RUnit
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeneralizedHyperbolic/gigParam.Rd_%03d_medium.png", width=480, height=480)
> ### Name: gigParam
> ### Title: Parameter Sets for the Generalized Inverse Gaussian Distribution
> ### Aliases: gigParam gigSmallParam gigLargeParam
> 
> ### ** Examples
> 
> data(gigParam)
> ## Check values of chi and psi
> plot(gigLargeParam[, 1], gigLargeParam[, 2])
> ### Check all three parameters
> pairs(gigLargeParam,
+   labels = c(expression(chi),expression(psi),expression(lambda)))
> 
> ## Testing the accuracy of gigMean
> for (i in 1:nrow(gigSmallParam)) {
+   param <- gigSmallParam[i, ]
+   x <- rgig(1000, param = param)
+   sampleMean <- mean(x)
+   funMean <- gigMean(param = param)
+   difference <- abs(sampleMean - funMean)
+   print(difference)
+ }
[1] 0.03688749
[1] 0.01868661
[1] 0.001371438
[1] 0.001105108
[1] 0.0007687541
[1] 0.1034409
[1] 0.02930043
[1] 0.003912259
[1] 0.000162484
[1] 0.001383287
[1] 0.08687455
[1] 0.1192183
[1] 0.01962599
[1] 0.0005573366
[1] 0.003096568
[1] 0.7624946
[1] 0.07430706
[1] 0.008559951
[1] 0.0005102836
[1] 0.002690373
[1] 0.4725633
[1] 0.1771149
[1] 0.01480983
[1] 2.931095e-05
[1] 0.002201112
[1] 0.222392
[1] 0.04204631
[1] 0.0157847
[1] 0.001655633
[1] 0.0007153337
[1] 0.01908906
[1] 0.06127062
[1] 0.009453381
[1] 0.0007985901
[1] 0.0009269446
[1] 0.4565738
[1] 0.1088782
[1] 0.0295942
[1] 0.001586069
[1] 0.001183328
[1] 0.8654103
[1] 0.0661452
[1] 0.01455587
[1] 0.005067247
[1] 0.001223059
[1] 0.5937163
[1] 0.1373333
[1] 0.04537331
[1] 0.01027492
[1] 0.005753284
[1] 0.6471954
[1] 0.02877117
[1] 0.03253135
[1] 0.007719492
[1] 0.0004689634
[1] 0.04330842
[1] 0.07476656
[1] 0.008863803
[1] 0.008705658
[1] 0.001805065
[1] 0.5502826
[1] 0.0983047
[1] 0.03877331
[1] 0.009741527
[1] 0.002073927
[1] 0.2570288
[1] 0.1900136
[1] 0.02832088
[1] 0.001177816
[1] 0.0008524538
[1] 0.1269969
[1] 0.1026772
[1] 0.04941963
[1] 0.03150559
[1] 0.00277909
[1] 0.001537946
[1] 0.2082894
[1] 0.0001317321
[1] 0.005255146
[1] 0.0005775915
[1] 1.043788
[1] 0.08610014
[1] 0.00443194
[1] 0.00471501
[1] 0.002264699
[1] 0.1598626
[1] 0.2775534
[1] 0.04846695
[1] 0.005182139
[1] 0.0006872922
[1] 0.5572172
[1] 0.05565141
[1] 0.02810908
[1] 0.003021317
[1] 0.0067894
[1] 0.3142985
[1] 0.2157362
[1] 0.0929736
[1] 0.0001163813
[1] 0.01076677
[1] 1.48305
[1] 0.01945554
[1] 0.03888865
[1] 0.01411377
[1] 0.004087226
[1] 0.5051564
[1] 0.328519
[1] 0.009666658
[1] 0.003969441
[1] 0.0001490491
[1] 0.2280001
[1] 0.5133054
[1] 0.08162022
[1] 0.008617357
[1] 0.002627795
[1] 0.6451646
[1] 0.1992872
[1] 0.1035598
[1] 0.006260936
[1] 0.001322862
[1] 0.6144554
[1] 0.1232696
[1] 0.02287866
[1] 0.008100727
[1] 0.009046536
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>