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("../R/skewhypCalcRange.R") > ## source("../R/dskewhyp.R") > ## source("../data/skewhypParam.R") > ## library(RUnit) > > options(digits=20) > param <- c(0,1,0,10) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.0000000000000000000000 0.0050597798677174876322 0.5000000000000085487173 [4] 0.9949402201322825600727 1.0000000000000000000000 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.0000000000000000000000 0.9949402201322825600727 0.4999999999999914512827 [4] 0.0050597798677174876322 0.0000000000000000000000 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.0000000000000000000000 0.0050597798677174876322 0.5000000000000085487173 [4] 0.9949402201322825600727 1.0000000000000000000000 $error [1] 0.0000000000000000000e+00 8.8382279082694546000e-09 [3] 2.9101858844797490189e-07 8.8382279082694546000e-09 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.0000000000000000000000 0.0050597798677168579276 0.5000000000000000000000 [4] 0.9949402201322831151842 1.0000000000000000000000 $error [1] 0.0000000000000000000e+00 9.4522427811183804495e-13 [3] 4.3216358832055912797e-13 9.4522427811183804495e-13 [5] 0.0000000000000000000e+00 > > x <- rskewhyp(1, param = param) > x [1] -0.1383029790030417816 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param) - x [1] -4.4564900402721541184e-06 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] -4.6628789718283769616e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8)) - x [1] -3.9859848754986160202e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10)) - x [1] -4.6628795269398892742e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12)) - x [1] -4.6628795269398892742e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, method = "integrate") - x [1] 1.6712721805034469469e-05 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] -4.6628789718283769616e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8), method = "integrate") - x [1] -3.1730174043786973925e-13 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10), method = "integrate") - x [1] -3.1741276274033225491e-13 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - x [1] 1.8268719870206950873e-13 > qskewhyp(pskewhyp(10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - 10 [1] 4.733006592871902285e-06 > qskewhyp(pskewhyp(-10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") + 10 [1] 0 > > > param <- c(0,1,10,20) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.0000000000000000000e+00 3.0202479310077259850e-11 [3] 1.4320837090861739463e-02 9.2058033544257789060e-01 [5] 1.0000000000000000000e+00 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.000000000000000000000 0.999999999969797492838 0.985679162909138262272 [4] 0.079419664557422123274 0.000000000000000000000 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.0000000000000000000e+00 3.0202479310077259850e-11 [3] 1.4320837090861739463e-02 9.2058033544257789060e-01 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 5.0126881260785777321e-13 [3] 2.2327119257288877141e-07 2.1508509075838334740e-06 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.0000000000000000000e+00 3.0202479310077259850e-11 [3] 1.4320837090859815655e-02 9.2058033544260398084e-01 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 5.0126881260785777321e-13 [3] 6.1804114711604591905e-13 2.6352684986252604368e-13 [5] 0.0000000000000000000e+00 > > x <- rskewhyp(1, param = param) > x [1] 0.46755309936840072638 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param) - x [1] 1.6411333680910189514e-07 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] 8.846575694221314734e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8)) - x [1] 8.7193985365274784272e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10)) - x [1] 8.7193952058584045517e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12)) - x [1] 8.7265017434390301787e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, method = "integrate") - x [1] -1.0504988573467599622e-07 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] 8.846575694221314734e-10 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8), method = "integrate") - x [1] -1.2702616736248728557e-12 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10), method = "integrate") - x [1] -1.2704282070785666292e-12 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - x [1] -1.1102230246251565404e-16 > qskewhyp(pskewhyp(10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - 10 [1] -9.0780504891085911368e-08 > qskewhyp(pskewhyp(-10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") + 10 [1] 0 > > param <- c(0,1,1,1) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.000000000000000000000 0.010135470718256579803 0.104496831525913755345 [4] 0.322961124807038535423 1.000000000000000000000 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.00000000000000000000 0.98986452928174339938 0.89550316847408628629 [4] 0.67703887519296146458 0.00000000000000000000 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.000000000000000000000 0.010135470718256579803 0.104496831525913755345 [4] 0.322961124807038535423 1.000000000000000000000 $error [1] 0.0000000000000000000e+00 5.1661317767154615824e-05 [3] 2.2491891314036383670e-06 1.3009229344884687407e-06 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.000000000000000000000 0.010135471470863730015 0.104496831502326165131 [4] 0.322961125086224432046 1.000000000000000000000 $error [1] 0.0000000000000000000e+00 5.9599438408025427701e-13 [3] 4.1833898735584422340e-15 5.1358917119159741560e-13 [5] 0.0000000000000000000e+00 > > > param <- c(0,1,-10,5) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.00000000000000000000 0.89470108678281801140 0.99974011858283340359 [4] 0.99999999997115651684 1.00000000000000000000 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.0000000000000000000e+00 1.0529891321718204411e-01 [3] 2.5988141716654517823e-04 2.8843521760143618581e-11 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.00000000000000000000 0.89470108678281801140 0.99974011858283340359 [4] 0.99999999997115651684 1.00000000000000000000 $error [1] 0.0000000000000000000e+00 1.0144195007666390040e-05 [3] 6.1748716144125928209e-06 6.9212763607351713781e-14 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.00000000000000000000 0.89470108673660231347 0.99974011857236144696 [4] 0.99999999997115651684 1.00000000000000000000 $error [1] 0.0000000000000000000e+00 4.6307818935905555521e-13 [3] 6.9926019130466539049e-15 6.9212763607351713781e-14 [5] 0.0000000000000000000e+00 > > > > param <- c(0,1,5,5) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.0000000000000000000e+00 2.1042213460332276638e-06 [3] 1.7688333265980456938e-02 4.1945787716632820796e-01 [5] 1.0000000000000000000e+00 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.00000000000000000000 0.99999789577865394463 0.98231166673401959510 [4] 0.58054212283367179204 0.00000000000000000000 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.0000000000000000000e+00 2.1042213460332276638e-06 [3] 1.7688333265980456938e-02 4.1945787716632820796e-01 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 4.0683148649406688634e-10 [3] 8.9465986717537305459e-05 8.8870044252345502603e-05 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.0000000000000000000e+00 2.1042213465720227806e-06 [3] 1.7688333883350781939e-02 4.1945785475253316577e-01 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 1.1718432880685096253e-13 [3] 8.9625986579175917031e-14 2.4424906541753443889e-15 [5] 0.0000000000000000000e+00 > > x <- rskewhyp(1, param = param) > x [1] 0.57563637206883000452 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param) - x [1] -0.00040425441304492437666 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] -0.00038528113406555153375 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8)) - x [1] -0.00038528113074720593545 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10)) - x [1] -0.00038528113074709491315 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12)) - x [1] -0.00038528113074709491315 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, method = "integrate") - x [1] -7.6965626816249965714e-07 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] -0.00038528113406555153375 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8), method = "integrate") - x [1] -6.3953731199717367417e-11 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10), method = "integrate") - x [1] 0 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - x [1] 1.1102230246251565404e-16 > qskewhyp(pskewhyp(10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - 10 [1] 3.9079850466805510223e-14 > qskewhyp(pskewhyp(-10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") + 10 [1] -7.1054273576010018587e-15 > > param <- c(1,2,20,10) > q <- c(-Inf,-1,0,1,Inf) > pskewhyp(q, param = param) [1] 0.0000000000000000000e+00 3.4816865395169593232e-40 [3] 1.2167570454280449106e-25 1.9951466373325599949e-14 [5] 1.0000000000000000000e+00 > pskewhyp(q, param = param, lower.tail = FALSE) [1] 1.00000000000000000000 1.00000000000000000000 1.00000000000000000000 [4] 0.99999999999998001599 0.00000000000000000000 > pskewhyp(q, param = param, valueOnly = FALSE) $value [1] 0.0000000000000000000e+00 3.4816865395169593232e-40 [3] 1.2167570454280449106e-25 1.9951466373325599949e-14 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 5.9519951601912459435e-40 [3] 4.1381227736839910551e-27 1.6240049404233942297e-16 [5] 0.0000000000000000000e+00 > pskewhyp(q, param = param, valueOnly = FALSE, intTol = 10^(-12)) $value [1] 0.0000000000000000000e+00 3.4816865395169593232e-40 [3] 1.2167570454280449106e-25 1.9951466373325599949e-14 [5] 1.0000000000000000000e+00 $error [1] 0.0000000000000000000e+00 5.9519951601912459435e-40 [3] 4.1381227736839910551e-27 1.6240049404233942297e-16 [5] 0.0000000000000000000e+00 > > x <- rskewhyp(1, param = param) > x [1] 11.417936418909171437 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param) - x [1] 5.8890275234091404855e-07 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] 2.5154978366970226489e-07 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8)) - x [1] 2.5163006611705895921e-07 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10)) - x [1] 2.5163006611705895921e-07 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12)) - x [1] 2.5163006611705895921e-07 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, method = "integrate") - x [1] 2.5123713307095840719e-05 > qskewhyp(pskewhyp(x, param = param), + param = param, uniTol = 10^(-10)) - x [1] 2.5154978366970226489e-07 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-8)), + param = param, uniTol = 10^(-8), method = "integrate") - x [1] 1.8829382497642654926e-13 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-10)), + param = param, uniTol = 10^(-10), method = "integrate") - x [1] 2.0250467969162855297e-13 > qskewhyp(pskewhyp(x, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - x [1] 2.0961010704922955483e-13 > qskewhyp(pskewhyp(10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") - 10 [1] 8.8817841970012523234e-15 > qskewhyp(pskewhyp(-10, param = param, intTol = 10^(-12)), + param = param, uniTol = 10^(-12), method = "integrate") + 10 [1] 0 > > proc.time() user system elapsed 2.620000000000000106581 0.040000000000000000833 2.669999999999999928946