R Under development (unstable) (2024-10-16 r87241 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.12 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.7564382 0.6665538 0.6232625 0.6000576 0.5820027 0.5721815 0.562053 [2,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.562500 [3,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.562500 [4,] 0.7500000 0.6666667 0.6250000 0.6000000 0.5833333 0.5714286 0.562500 [,8] [1,] 0.5582221 [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.6702756 0.5551336 0.5018505 0.4683157 0.4420235 0.4305494 0.4197641 [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.4074284 [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.6954557 0.5981069 0.5548077 0.5144113 0.4985159 0.4801902 0.4732488 [2,] 0.7000000 0.6000000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [3,] 0.7000000 0.6000000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [4,] 0.7000000 0.6000000 0.5500000 0.5200000 0.5000000 0.4857143 0.4750000 [,8] [1,] 0.4684209 [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.8557502 0.8158121 0.7945116 0.7775048 0.7690334 0.7618492 0.7572760 [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.7523759 [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.7879231 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.7363302 0.7324868 0.7324868 0.7324867 > > proc.time() user system elapsed 1.34 0.18 1.53