R Under development (unstable) (2026-01-19 r89308 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 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. > library(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.14 Date: BugReport: https://github.com/spedygiorgio/mbbefd/issues > > #test of beta distribution > n <- 1e4 > > x <- roibeta(n, 2, 2, p1=0) > y <- roibeta(n, 4/3, 2/3, p1=0) > > #test CDF > z <- 0:10/10 > cbind(ecdf(x)(z), poibeta(z, 2, 2, 0)) [,1] [,2] [1,] 0.0000 0.000 [2,] 0.0276 0.028 [3,] 0.0979 0.104 [4,] 0.2054 0.216 [5,] 0.3398 0.352 [6,] 0.4866 0.500 [7,] 0.6425 0.648 [8,] 0.7830 0.784 [9,] 0.8984 0.896 [10,] 0.9722 0.972 [11,] 1.0000 1.000 > > cbind(ecdf(y)(z), poibeta(z, 4/3, 2/3, 0)) [,1] [,2] [1,] 0.0000 0.00000000 [2,] 0.0292 0.02936482 [3,] 0.0768 0.07560159 [4,] 0.1290 0.13290373 [5,] 0.1931 0.20018980 [6,] 0.2738 0.27757936 [7,] 0.3655 0.36608701 [8,] 0.4652 0.46791349 [9,] 0.5836 0.58758551 [10,] 0.7373 0.73638534 [11,] 1.0000 1.00000000 > > #total loss > c(etl(x), tloibeta(2, 2, 0)) [1] 0 0 > c(etl(y), tloibeta(4/3, 2/3, 0)) [1] 0 0 > > #mean > c(mean(x), moibeta(1, 2, 2, 0)) [1] 0.5044577 0.5000000 > c(mean(y), moibeta(1, 4/3, 2/3, 0)) [1] 0.6691939 0.6666667 > > > #test EC > cbind(eecf(x)(z), ecoibeta(z, 2, 2, 0)) [,1] [,2] [1,] 0.0000000 0.0000 [2,] 0.1963948 0.1981 [3,] 0.3827082 0.3856 [4,] 0.5515021 0.5541 [5,] 0.6959507 0.6976 [6,] 0.8123998 0.8125 [7,] 0.8983490 0.8976 [8,] 0.9552316 0.9541 [9,] 0.9860367 0.9856 [10,] 0.9981364 0.9981 [11,] 1.0000000 1.0000 > cbind(eecf(y)(z), ecoibeta(z, 4/3, 2/3, 0)) [,1] [,2] [1,] 0.0000000 0.0000000 [2,] 0.1476632 0.1481237 [3,] 0.2893622 0.2904043 [4,] 0.4234772 0.4248943 [5,] 0.5490551 0.5500358 [6,] 0.6636655 0.6643336 [7,] 0.7655010 0.7662079 [8,] 0.8532126 0.8538450 [9,] 0.9248347 0.9249505 [10,] 0.9762698 0.9761506 [11,] 1.0000000 1.0000000 > > > > #plots > n <- 1e5 > n <- 1e2 > x <- roibeta(n, 2, 2, p1=0) > y <- roibeta(n, 4/3, 2/3, p1=0) > > > plot(eecf(x), do.points=FALSE) > v <- seq(0, 1, length=101) > lines(v, ecoibeta(v, 2, 2, 0), lty=3, col="red") > > > plot(eecf(y), do.points=FALSE) > v <- seq(0, 1, length=101) > lines(v, ecoibeta(v, 4/3, 2/3, 0), lty=3, col="red") > > > proc.time() user system elapsed 1.78 0.26 2.03