R Under development (unstable) (2024-12-17 r87446 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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.13 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.7493779 0.6669012 0.6257207 0.5999105 0.5839585 0.5725067 0.5582768 [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.5544462 [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.6633872 0.5598543 0.5038806 0.4661407 0.4478714 0.4189248 0.4204985 [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.4080310 [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.6955096 0.6027024 0.5466548 0.52209 0.5025914 0.4846307 0.4792191 [2,] 0.7000000 0.6000000 0.5500000 0.52000 0.5000000 0.4857143 0.4750000 [3,] 0.7000000 0.6000000 0.5500000 0.52000 0.5000000 0.4857143 0.4750000 [4,] 0.7000000 0.6000000 0.5500000 0.52000 0.5000000 0.4857143 0.4750000 [,8] [1,] 0.4659444 [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.8621439 0.8152837 0.7922294 0.7795669 0.7656106 0.7636573 0.7565879 [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.7536808 [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.7942404 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.7327096 0.7324868 0.7324868 0.7324867 > > proc.time() user system elapsed 1.65 0.25 2.00