regressionTests/testdghyp.R

detach("package:GeneralizedHyperbolic")
detach("package:HyperbolicDist")
library(GeneralizedHyperbolic)
gParam <- c(0, 1, 3, 1, 0.5)
hParam <- c(0.5, 3, 1, 1, 0)
sampleInput <- rghyp(100, param = gParam)
gdResult <- dghyp(sampleInput, param = gParam)
gpResult <- pghyp(seq(-2, 5, 0.2), param = gParam)
gqResult <- qghyp(seq(0.1, 0.9, 0.1), param = gParam)
detach("package:GeneralizedHyperbolic")
library(HyperbolicDist)
hdResult <- dghyp(sampleInput, Theta = hParam)
hpResult <- pghyp(seq(-2, 5, 0.2), Theta = hParam)
hqResult <- qghyp(seq(0.1, 0.9, 0.1), Theta = hParam)
detach("package:HyperbolicDist")

checkEqual(gdResult, hdResult, "dghyp")
checkEqual(gpResult, hpResult, "pghyp")
checkEqual(gqResult, hqResult, "qghyp")
sjp/GeneralizedHyperbolic documentation built on May 26, 2017, 10:13 a.m.