R Under development (unstable) (2023-08-27 r85021 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(mbbefd) Loading required package: mbbefd Loading required package: fitdistrplus Loading required package: MASS Loading required package: survival Loading required package: alabama Loading required package: numDeriv Loading required package: Rcpp Package: mbbefd Version: 0.8.11 Date: BugReport: https://github.com/spedygiorgio/mbbefd/issues > > #check of expectation for oi distribution > n <- 1e4 > > probs <- c(1/(2:9)) > > sapply(probs, function(p) + { + x <- roiunif(n, p) + c(mean(x), mbbefd:::tmean1(doiunif, p1=p), + mbbefd:::tmean2(poiunif, p1=p), mbbefd:::tmean3(ecoiunif, p1=p)) + } + ) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7531887 0.6668100 0.6190299 0.5998477 0.5849007 0.5701740 0.5612537 [2,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.5625000 [3,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.5625000 [4,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.5625000 [,8] [1,] 0.5544389 [2,] 0.5555556 [3,] 0.5555556 [4,] 0.5555556 > > > > sapply(probs, function(p) + { + x <- roistpareto(n, a=2, p) + c(mean(x), mbbefd:::tmean1(doistpareto, a=2, p1=p), + mbbefd:::tmean2(poistpareto, a=2, p1=p), mbbefd:::tmean3(ecoistpareto, a=2, p1=p)) + } + ) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6691121 0.5584525 0.5033099 0.4659239 0.4444134 0.4301975 0.4118391 [2,] 0.6666667 0.5555556 0.5000000 0.4666667 0.4444444 0.4285714 0.4166667 [3,] 0.6666667 0.5555556 0.5000000 0.4666667 0.4444444 0.4285714 0.4166667 [4,] 0.6666666 0.5555555 0.5000000 0.4666666 0.4444444 0.4285714 0.4166666 [,8] [1,] 0.4091531 [2,] 0.4074074 [3,] 0.4074074 [4,] 0.4074074 > > > > > sapply(probs, function(p) + { + x <- roibeta(n, shape1=2, shape2=3, p) + c(mean(x), mbbefd:::tmean1(doibeta, shape1=2, shape2=3, p1=p), + mbbefd:::tmean2(poibeta, shape1=2, shape2=3, p1=p), + mbbefd:::tmean3(ecoibeta, shape1=2, shape2=3, p1=p)) + } + ) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7000653 0.594288 0.5472123 0.5208097 0.5035943 0.4857366 0.4721733 [2,] 0.7000000 0.600000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [3,] 0.7000000 0.600000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [4,] 0.7000000 0.600000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [,8] [1,] 0.4641706 [2,] 0.4666667 [3,] 0.4666667 [4,] 0.4666667 > > > sapply(probs, function(p) + { + x <- roigbeta(n, shape0=pi, shape1=2, shape2=3, p) + c(mean(x), mbbefd:::tmean1(doigbeta, shape0=pi, shape1=2, shape2=3, p1=p), + mbbefd:::tmean2(poigbeta, shape0=pi, shape1=2, shape2=3, p1=p), + mbbefd:::tmean3(ecoigbeta, shape0=pi, shape1=2, shape2=3, p1=p)) + } + ) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.8619611 0.8154639 0.7892509 0.7794964 0.7680969 0.7628191 0.7595084 [2,] 0.8612260 0.8149680 0.7918390 0.7779616 0.7687100 0.7621017 0.7571455 [3,] 0.8612260 0.8149680 0.7918390 0.7779616 0.7687100 0.7621017 0.7571455 [4,] 0.8612260 0.8149680 0.7918390 0.7779616 0.7687100 0.7621017 0.7571455 [,8] [1,] 0.7523184 [2,] 0.7532907 [3,] 0.7532907 [4,] 0.7532907 > > > x <- rmbbefd(n, a=2, b=1/2) > c(mean(x), mbbefd:::tmean1(dmbbefd, a=2, b=1/2), + mbbefd:::tmean2(pmbbefd, a=2, b=1/2), + mbbefd:::tmean3(ecmbbefd, a=2, b=1/2)) [1] 0.7935945 0.7891032 0.7891032 0.7891032 > > > x <- rmbbefd(n, a=-1/2, b=3) > c(mean(x), mbbefd:::tmean1(dmbbefd, a=-1/2, b=3), + mbbefd:::tmean2(pmbbefd, a=-1/2, b=3), + mbbefd:::tmean3(ecmbbefd, a=-1/2, b=3)) [1] 0.7320979 0.7324868 0.7324868 0.7324867 > > proc.time() user system elapsed 1.09 0.20 1.28