R Under development (unstable) (2024-07-10 r86888 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(fitdistrplus) Loading required package: MASS Loading required package: survival > nbboot <- 100 > nbboot <- 10 > > nsample <- 100 > nsample <- 10 > > visualize <- FALSE # TRUE for manual tests with visualization of results > > > #### sanity check -- data #### > > try(fitdist(c(serving, "a"), "gamma")) Error : object 'serving' not found > try(fitdist(c(serving, NA), "gamma")) Error : object 'serving' not found > try(fitdist(c(serving, Inf), "gamma")) Error : object 'serving' not found > try(fitdist(c(serving, -Inf), "gamma")) Error : object 'serving' not found > try(fitdist(c(serving, NaN), "gamma")) Error : object 'serving' not found > > #### sanity check -- distr #### > > try(fitdist(serving, "toto")) Error in fitdist(serving, "toto") : The dtoto function must be defined > > #### sanity check -- method #### > > try(fitdist(serving, "gamma", method="toto")) Error in match.arg(method, c("mle", "mme", "qme", "mge", "mse")) : 'arg' should be one of "mle", "mme", "qme", "mge", "mse" > try(fitdist(serving, "gamma", method=1)) Error in match.arg(method, c("mle", "mme", "qme", "mge", "mse")) : 'arg' must be NULL or a character vector > > #### sanity check -- start #### > > try(fitdist(serving, "gamma", start=list("a"=1, b=2))) Error : object 'serving' not found > > #### sanity check -- fix.arg #### > > try(fitdist(serving, "gamma", fix.arg=list("a"=1, b=2))) Error : object 'serving' not found > try(fitdist(serving, "gamma", fix.arg=list("shape"=1, rate=2))) Error : object 'serving' not found > > > #### sanity check -- discrete #### > > try(fitdist(serving, "gamma", discrete=3)) Error in fitdist(serving, "gamma", discrete = 3) : wrong argument 'discrete'. > > #### sanity check -- keepdata #### > > try(fitdist(serving, "gamma", keepdata=3)) Error in fitdist(serving, "gamma", keepdata = 3) : wrong arguments 'keepdata' and 'keepdata.nb' > try(fitdist(serving, "gamma", keepdata=TRUE, keepdata.nb = 1)) Error in fitdist(serving, "gamma", keepdata = TRUE, keepdata.nb = 1) : wrong arguments 'keepdata' and 'keepdata.nb' > > > #### sanity check -- calcvcov #### > > try(fitdist(serving, "gamma", calcvcov=3)) Error in fitdist(serving, "gamma", calcvcov = 3) : wrong argument 'calcvcov'. > > > #### check the warning messages when using weights in the fit followed by functions #### > # that do not yet take weights into account > # with an example to be used later to see if weights are well taken into account > # > if(visualize) + { + x3 <- rnorm(100) # this sample size must be fixed here (see next lines, 50+50) + x3 <- sort(x3) + (f <- fitdist(x3, "norm", method="mle", weights= c(rep(1, 50), rep(2, 50)))) + try(plot(f)) + try(cdfcomp(f)) + (f2 <- fitdist(x3, "logis", method="mle", weights= c(rep(1, 50), rep(2, 50)))) + try(cdfcomp(list(f,f2))) + try(denscomp(f)) + try(denscomp(list(f,f2))) + try(ppcomp(f)) + try(ppcomp(list(f,f2))) + try(qqcomp(f)) + try(qqcomp(list(f,f2))) + try(gofstat(f)) + try(gofstat(list(f,f2))) + try(bootdist(f)) + } > > proc.time() user system elapsed 1.45 0.18 1.62