R Under development (unstable) (2023-11-23 r85618 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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. > require(SkewHyperbolic) Loading required package: SkewHyperbolic > ## source("skewhypCalcRange.R") > ## source("dskewhyp.R") > > ### default case: density = TRUE > param <- c(0,1,0,10) > (range <- skewhypCalcRange(param = param)) [1] -2.72453 2.72453 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(1,1,0,10) > (range <- skewhypCalcRange(param = param)) [1] -1.72453 3.72453 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(-2,1,0,10) > (range <- skewhypCalcRange(param = param)) [1] -4.7245304 0.7245304 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,10,20) > (range <- skewhypCalcRange(param = param)) [1] -0.5892318 3.7388396 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,10,10) > (range <- skewhypCalcRange(param = param)) [1] -0.5454435 14.7072786 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,20,1) > (range <- skewhypCalcRange(param = param)) [1] 0.5413719 3162.5415536 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,-10,20) > (range <- skewhypCalcRange(param = param)) [1] -3.7388396 0.5892318 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,-10,10) > (range <- skewhypCalcRange(param = param)) [1] -14.7072786 0.5454435 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > param <- c(0,1,-20,1) > (range <- skewhypCalcRange(param = param)) [1] -3162.5415536 -0.5413719 > round(dskewhyp(range, param = param),7) [1] 1e-05 1e-05 > > ### cdf case: density = FALSE > param <- c(0,1,0,10) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -2.380245 2.380245 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(1,1,0,10) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -1.380245 3.380245 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(-2,1,0,10) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -4.3802445 0.3802445 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(0,1,10,20) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -0.4433923 3.3871389 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(0,1,10,10) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -0.3792807 18.5773496 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(0,1,-10,20) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -3.3871389 0.4433923 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > param <- c(0,1,-10,10) > (range <- skewhypCalcRange(param = param, density = FALSE)) [1] -18.5773496 0.3792807 > round(integrate(dskewhyp, -Inf, range[1], param = param)$value,7) [1] 1e-05 > round(integrate(dskewhyp, range[2], Inf, param = param)$value,7) [1] 1e-05 > > proc.time() user system elapsed 0.21 0.03 0.25