R Under development (unstable) (2023-08-27 r85021 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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.11 Date: BugReport: https://github.com/spedygiorgio/mbbefd/issues > > data(asiacomrisk) > x <- asiacomrisk$DR > x <- x[!is.na(x)] > > plot(ecdf(x)) > plot(eecf(x)) > etl(x) [1] 0.02150538 > > #test optim method > if(FALSE) + { + fitDR(x, "oistpareto", control=list(trace=TRUE)) + + fitDR(x, "oibeta", control=list(trace=TRUE)) + fitDR(x, "oibeta", control=list(trace=TRUE), optim.method="L-BFGS-B") + + fitDR(x, "oigbeta", control=list(trace=TRUE)) + fitDR(x, "oigbeta", control=list(trace=TRUE), optim.method="L-BFGS-B") + fitDR(x, "oigbeta", control=list(trace=TRUE), optim.method="BFGS") + } > > dlist <- c("oiunif", "oistpareto", "oibeta", "oigbeta") > flist <- lapply(dlist, function(d) { + cat("distribution:", d, "\n"); + fitDR(x, d, method="mle", optim.method=ifelse(d=="oigbeta", "BFGS", "default"))}) distribution: oiunif distribution: oistpareto distribution: oibeta distribution: oigbeta > names(flist) <- dlist > > > cdfcomp(flist, do.points=FALSE, leg=dlist) > > ppcomp(flist, leg=dlist, fitpch=".", addlegend = FALSE) > legend("bottomright", fill=c("red", "green", "blue", "cyan"), leg=dlist) > > eccomp(flist, leg=dlist, do.points = FALSE) > > qqcomp(flist, leg=dlist, use.ppoints=TRUE) Warning messages: 1: In qfun(p, lower.tail = TRUE, log.p = FALSE, ...) : NaNs produced 2: In qfun(p, lower.tail = TRUE, log.p = FALSE, ...) : NaNs produced 3: In qbeta(p, shape1, shape2, lower.tail = TRUE, log.p = FALSE) : NaNs produced > > proc.time() user system elapsed 1.32 0.15 1.48