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 shifted truncated pareto distribution > n <- 1e4 > > x <- rstpareto(n, 2) > y <- rstpareto(n, 1/2) > > #test CDF > z <- 0:10/10 > cbind(ecdf(x)(z), pstpareto(z, 2)) [,1] [,2] [1,] 0.0000 0.0000000 [2,] 0.2359 0.2314050 [3,] 0.4092 0.4074074 [4,] 0.5493 0.5443787 [5,] 0.6564 0.6530612 [6,] 0.7420 0.7407407 [7,] 0.8142 0.8125000 [8,] 0.8715 0.8719723 [9,] 0.9231 0.9218107 [10,] 0.9665 0.9639889 [11,] 1.0000 1.0000000 > > cbind(ecdf(y)(z), pstpareto(z, 1/2)) [,1] [,2] [1,] 0.0000 0.0000000 [2,] 0.1555 0.1588887 [3,] 0.2957 0.2974773 [4,] 0.4200 0.4197502 [5,] 0.5288 0.5286764 [6,] 0.6268 0.6265199 [7,] 0.7151 0.7150407 [8,] 0.7999 0.7956313 [9,] 0.8749 0.8694090 [10,] 0.9422 0.9372827 [11,] 1.0000 1.0000000 > > #mean > c(mean(x), mstpareto(1, 2)) [1] 0.3310963 0.3333333 > c(mean(y), mstpareto(1, 1/2)) [1] 0.4136681 0.4142136 > > #test EC > cbind(eecf(x)(z), ecstpareto(z, 2)) [,1] [,2] [1,] 0.0000000 0.0000000 [2,] 0.2641222 0.2636364 [3,] 0.4675690 0.4666667 [4,] 0.6237492 0.6230769 [5,] 0.7431018 0.7428571 [6,] 0.8337378 0.8333333 [7,] 0.9005504 0.9000000 [8,] 0.9476496 0.9470588 [9,] 0.9784134 0.9777778 [10,] 0.9950955 0.9947368 [11,] 1.0000000 1.0000000 > > cbind(eecf(y)(z), ecstpareto(z, 1/2)) [,1] [,2] [1,] 0.0000000 0.0000000 [2,] 0.2224032 0.2217849 [3,] 0.4094935 0.4077542 [4,] 0.5645778 0.5623032 [5,] 0.6915800 0.6889957 [6,] 0.7937232 0.7907689 [7,] 0.8731146 0.8700772 [8,] 0.9315905 0.9289968 [9,] 0.9707525 0.9693028 [10,] 0.9931069 0.9925264 [11,] 1.0000000 1.0000000 > > > plot(eecf(x)) > v <- seq(0, 1, length=101) > lines(v, ecstpareto(v, 2), lty=3, col="red") > > > plot(eecf(y)) > v <- seq(0, 1, length=101) > lines(v, ecstpareto(v, 1/2), lty=3, col="red") > > > proc.time() user system elapsed 2.20 0.32 2.46