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. > 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.12 Date: BugReport: https://github.com/spedygiorgio/mbbefd/issues > > testfunc <- function(x) + c(summary(x), sd=sd(x), tl=etl(x)) > extensive <- TRUE > extensive <- FALSE > > > # test invalid param > n <- 5 > a <- 0 > b <- -1/2 > mbbefd:::rmbbefdCpp(n, a, b) [1] NaN NaN NaN NaN NaN > mbbefd:::rmbbefdR(n, a, b) [1] NaN > g <- 1/2 > b <- 3 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] NaN NaN NaN NaN NaN > mbbefd:::rMBBEFDR(n, g, b) [1] NaN NaN NaN NaN NaN > > > #test of MBBEFD(a,b) distribution > > n <- 10 > a <- 0 > b <- 1/2 > > mbbefd:::rmbbefdCpp(n, a, b) [1] 1 1 1 1 1 1 1 1 1 1 > mbbefd:::rmbbefdR(n, a, b) [1] 1 1 1 1 1 1 1 1 1 1 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rmbbefdCpp(n, a, b))) + print(testfunc(mbbefd:::rmbbefdR(n, a, b))) + } > > a <- 1/2 > b <- 1 > n <- 10 > > mbbefd:::rmbbefdCpp(n, a, b) [1] 1 1 1 1 1 1 1 1 1 1 > mbbefd:::rmbbefdR(n, a, b) [1] 1 1 1 1 1 1 1 1 1 1 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rmbbefdCpp(n, a, b))) + print(testfunc(mbbefd:::rmbbefdR(n, a, b))) + } > > a <- -1/2 > b <- 3 > n <- 10 > > mbbefd:::rmbbefdCpp(n, a, b) [1] 0.10891371 1.00000000 1.00000000 1.00000000 1.00000000 0.93196248 [7] 0.87486521 0.19292026 0.26576104 0.02978964 > mbbefd:::rmbbefdR(n, a, b) [1] 1.000000000 0.094385335 1.000000000 1.000000000 1.000000000 1.000000000 [7] 1.000000000 0.004298301 0.211059210 0.007969180 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rmbbefdCpp(n, a, b))) + print(testfunc(mbbefd:::rmbbefdR(n, a, b))) + } > > a <- Inf > b <- 1/3 > n <- 10 > > mbbefd:::rmbbefdCpp(n, a, b) [1] 0.2522067 0.2658761 0.7931858 1.0000000 0.1821716 0.8245719 1.0000000 [8] 1.0000000 0.8466529 1.0000000 > mbbefd:::rmbbefdR(n, a, b) [1] 0.6490053 0.8061957 0.4140936 0.3969304 0.6754099 1.0000000 0.3676432 [8] 1.0000000 1.0000000 0.7795852 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rmbbefdCpp(n, a, b))) + print(testfunc(mbbefd:::rmbbefdR(n, a, b))) + } > > > > > #test of MBBEFD(g,b) distribution > > n <- 10 > g <- 1 > b <- 1/2 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] 1 1 1 1 1 1 1 1 1 1 > mbbefd:::rMBBEFDR(n, g, b) [1] 1 1 1 1 1 1 1 1 1 1 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rMBBEFDCpp(n, g, b))) + print(testfunc(mbbefd:::rMBBEFDR(n, g, b))) + } > > n <- 10 > g <- 2 > b <- 0 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] 1 1 1 1 1 1 1 1 1 1 > mbbefd:::rMBBEFDR(n, g, b) [1] 1 1 1 1 1 1 1 1 1 1 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rMBBEFDCpp(n, g, b))) + print(testfunc(mbbefd:::rMBBEFDR(n, g, b))) + } > > > n <- 10 > g <- 2 > b <- 1/2 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] 0.4882178 0.1708374 0.8551339 1.0000000 0.2648229 0.3777463 1.0000000 [8] 1.0000000 1.0000000 1.0000000 > mbbefd:::rMBBEFDR(n, g, b) [1] 1.0000000 1.0000000 0.1656487 0.7831860 1.0000000 1.0000000 0.0989736 [8] 0.7837428 1.0000000 0.4745270 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rMBBEFDCpp(n, g, b))) + print(testfunc(mbbefd:::rMBBEFDR(n, g, b))) + } > > n <- 10 > g <- 2 > b <- 1 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] 1.00000000 0.35098262 0.28142495 0.70903063 1.00000000 1.00000000 [7] 0.07818766 1.00000000 1.00000000 0.43083933 > mbbefd:::rMBBEFDR(n, g, b) [1] 0.04557029 0.38874710 0.08831966 0.97305276 0.19790452 0.31349925 [7] 1.00000000 0.35270594 0.01350596 1.00000000 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rMBBEFDCpp(n, g, b))) + print(testfunc(mbbefd:::rMBBEFDR(n, g, b))) + } > > n <- 10 > g <- 2 > b <- 3 > > mbbefd:::rMBBEFDCpp(n, g, b) [1] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.6408406 1.0000000 [8] 1.0000000 1.0000000 1.0000000 > mbbefd:::rMBBEFDR(n, g, b) [1] 1.00000000 1.00000000 0.13863278 1.00000000 1.00000000 1.00000000 [7] 1.00000000 0.01192643 0.69667309 0.34346965 > if(extensive) + { + n <- 1e6 + print(testfunc(mbbefd:::rMBBEFDCpp(n, g, b))) + print(testfunc(mbbefd:::rMBBEFDR(n, g, b))) + } > > proc.time() user system elapsed 1.20 0.26 1.40