Running ‘t-CIcdfplot.R’ [17s/24s]
  Running ‘t-Surv2fitdistcens.R’ [2s/3s]
  Running ‘t-bootdist.R’ [4s/8s]
  Running ‘t-bootdistcens.R’ [3s/4s]
  Running ‘t-cdfcomp.R’ [4s/6s]
  Running ‘t-cdfcompcens.R’ [5s/8s]
  Running ‘t-cvg-algo.R’ [0s/1s]
  Running ‘t-denscomp.R’ [5s/7s]
  Running ‘t-descdist.R’ [2s/4s]
  Running ‘t-detectbound.R’ [2s/3s]
  Running ‘t-fitbench.R’ [0s/1s]
  Running ‘t-fitdist-customoptim.R’ [2s/4s]
  Running ‘t-fitdist.R’ [3s/5s]
  Running ‘t-fitdistcens.R’ [4s/6s]
  Running ‘t-gen-max-spacing-estim.R’ [2s/4s]
  Running ‘t-getparam.R’ [2s/3s]
  Running ‘t-gofstat.R’ [2s/3s]
  Running ‘t-init-actuar.R’ [0s/1s]
  Running ‘t-llplot.R’ [3s/4s]
  Running ‘t-lnL-surf.R’ [2s/5s]
  Running ‘t-logLik-vcov-coef.R’ [2s/3s]
  Running ‘t-manageparam.R’ [2s/3s]
  Running ‘t-mgedist.R’ [2s/3s]
  Running ‘t-mledist-cens.R’ [2s/4s]
  Running ‘t-mledist-nocens.R’ [2s/4s]
  Running ‘t-mledist-paramsupport.R’ [2s/4s]
  Running ‘t-mmedist.R’ [5s/7s]
  Running ‘t-msedist.R’ [3s/5s]
  Running ‘t-parallel.R’ [0s/1s]
  Running ‘t-plotdist.R’ [2s/4s]
  Running ‘t-plotdistcens.R’ [3s/4s]
  Running ‘t-ppcomp.R’ [4s/7s]
  Running ‘t-ppcompcens.R’ [4s/8s]
  Running ‘t-prefit.R’ [2s/4s]
  Running ‘t-qme-discrete.R’ [9s/16s]
  Running ‘t-qmedist.R’ [6s/10s]
  Running ‘t-qqcomp.R’ [5s/9s]
  Running ‘t-qqcompcens.R’ [5s/8s]
  Running ‘t-quantiledist.R’ [2s/4s]
  Running ‘t-startfixarg-overall.R’ [3s/5s]
  Running ‘t-startingvalues.R’ [2s/3s]
  Running ‘t-util-npmle.R’ [2s/3s]
  Running ‘t-util-npsurv-mainfunction.R’ [2s/3s]
  Running ‘t-util-testdensity.R’ [2s/3s]
  Running ‘t-weird-ppcomp-cens.R’ [2s/3s]
  Running ‘t-weird-qqcomp-cens.R’ [2s/4s]
Running the tests in ‘tests/t-mgedist.R’ failed.
Complete output:
  > library(fitdistrplus)
  Loading required package: MASS
  Loading required package: survival
  > 
  > nsample <- 10
  > 
  > # (1) Fit of a Weibull distribution to serving size data by maximum 
  > # goodness-of-fit estimation using all the distances available
  > # 
  > 
  > data(groundbeef)
  > serving <- groundbeef$serving
  > mgedist(serving, "weibull", gof="CvM")
  $estimate
      shape     scale 
   2.093204 82.660014 
  
  $convergence
  [1] 0
  
  $value
  [1] 0.6556672
  
  $hessian
             shape      scale
  shape 4.05295367 0.09244476
  scale 0.09244476 0.02418777
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        65       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.623
  
  $gof
  [1] "CvM"
  
  > mgedist(serving, "weibull", gof="CvM", silent = FALSE)
  $estimate
      shape     scale 
   2.093204 82.660014 
  
  $convergence
  [1] 0
  
  $value
  [1] 0.6556672
  
  $hessian
             shape      scale
  shape 4.05295367 0.09244476
  scale 0.09244476 0.02418777
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        65       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.623
  
  $gof
  [1] "CvM"
  
  Warning messages:
  1: In pweibull(c(10, 11.5, 17, 20, 20, 20, 20, 20, 20, 20, 20, 24,  :
    NaNs produced
  2: In pweibull(c(10, 11.5, 17, 20, 20, 20, 20, 20, 20, 20, 20, 24,  :
    NaNs produced
  > mgedist(serving, "weibull", gof="KS")
  $estimate
      shape     scale 
   2.065634 81.450487 
  
  $convergence
  [1] 0
  
  $value
  [1] 0.112861
  
  $hessian
             shape    scale
  shape 122.668263 6.509057
  scale   6.509057 7.599584
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
       127       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.975
  
  $gof
  [1] "KS"
  
  > mgedist(serving, "weibull", gof="AD")
  $estimate
      shape     scale 
   2.125473 82.890260 
  
  $convergence
  [1] 0
  
  $value
  [1] 3.501035
  
  $hessian
             shape     scale
  shape 29.4165108 0.1823375
  scale  0.1823375 0.1354409
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        63       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.392
  
  $gof
  [1] "AD"
  
  > mgedist(serving, "weibull", gof="ADR")
  $estimate
      shape     scale 
   2.072087 82.761868 
  
  $convergence
  [1] 0
  
  $value
  [1] 1.610479
  
  $hessian
             shape       scale
  shape 13.5240921 -0.33242262
  scale -0.3324226  0.07977375
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        65       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.836
  
  $gof
  [1] "ADR"
  
  > mgedist(serving, "weibull", gof="ADL")
  $estimate
      shape     scale 
   2.197498 82.016005 
  
  $convergence
  [1] 0
  
  $value
  [1] 1.845939
  
  $hessian
             shape      scale
  shape 15.3272022 0.54407116
  scale  0.5440712 0.05549883
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        65       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1255.415
  
  $gof
  [1] "ADL"
  
  > mgedist(serving, "weibull", gof="AD2R")
  $estimate
     shape    scale 
   1.90328 81.33464 
  
  $convergence
  [1] 0
  
  $value
  [1] 11.56415
  
  $hessian
            shape       scale
  shape 334.61081 -10.4227495
  scale -10.42275   0.5223167
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        67       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1259.112
  
  $gof
  [1] "AD2R"
  
  > mgedist(serving, "weibull", gof="AD2L")
  $estimate
      shape     scale 
   2.483836 78.252113 
  
  $convergence
  [1] 0
  
  $value
  [1] 9.786977
  
  $hessian
             shape     scale
  shape 113.511932 4.1108355
  scale   4.110836 0.2341312
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        69       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1265.933
  
  $gof
  [1] "AD2L"
  
  > mgedist(serving, "weibull", gof="AD2")
  $estimate
      shape     scale 
   2.081168 85.281194 
  
  $convergence
  [1] 0
  
  $value
  [1] 26.95166
  
  $hessian
           shape       scale
  shape 534.9606 -10.5940982
  scale -10.5941   0.7606462
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        67       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -1256.313
  
  $gof
  [1] "AD2"
  
  > 
  > # (2) Fit of a uniform distribution using Cramer-von Mises or
  > # Kolmogorov-Smirnov distance
  > # 
  > 
  > set.seed(1234)
  > u <- runif(nsample, min=5, max=10)
  > mgedist(u, "unif", gof="CvM")
  $estimate
  min max 
    0   1 
  
  $convergence
  [1] 0
  
  $value
  [1] 3.333333
  
  $hessian
      min max
  min   0   0
  max   0   0
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
         3       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -Inf
  
  $gof
  [1] "CvM"
  
  > mgedist(u, "unif", gof="KS")
  $estimate
  min max 
    0   1 
  
  $convergence
  [1] 0
  
  $value
  [1] 1
  
  $hessian
      min max
  min   0   0
  max   0   0
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "Nelder-Mead"
  
  $fix.arg
  NULL
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
         3       NA 
  
  $optim.message
  NULL
  
  $loglik
  [1] -Inf
  
  $gof
  [1] "KS"
  
  > 
  > # (3) Fit of a triangular distribution using Cramer-von Mises or
  > # Kolmogorov-Smirnov distance
  > # 
  > require(mc2d)
  Loading required package: mc2d
  Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'mc2d'
  > set.seed(1234)
  > t <- rtriang(nsample, min=5, mode=6, max=10)
  Error in rtriang(nsample, min = 5, mode = 6, max = 10) : 
    could not find function "rtriang"
  Execution halted
Running the tests in ‘tests/t-mledist-paramsupport.R’ failed.
Complete output:
  > library(fitdistrplus)
  Loading required package: MASS
  Loading required package: survival
  > 
  > 
  > 
  > set.seed(1234)
  > nsample <- 10
  > 
  > 
  > # (1) uniform distribution fit - no fixed value
  > 
  > #manual check
  > dunif2 <- function(x, min, max)
  +   dunif(x, min, max)
  > punif2 <- function(q, min, max)
  +   punif(q, min, max)
  > 
  > x1 <- runif(nsample, 3, 5)
  > 
  > L <- function(a, b, obs)
  +   prod(dunif(obs, min=a, max=b))
  > l <- Vectorize(L, "a")
  > curve(l(x, b=5, obs=x1), from=1, to=3)
  > 
  > f1 <- fitdist(x1, "unif")
  > f2 <- fitdist(x1, "unif2", start=list(min=0, max=10), lower=c(-Inf, max(x1)),
  +               upper=c(min(x1), Inf))
  > c(logLik(f1), logLik(f2))
  [1] -5.322970 -5.323165
  > 
  > delta <- .2
  > llsurface(x1, "unif", plot.arg = c("min", "max"), min.arg=c(1, 5-delta),
  +           max.arg=c(3+delta, 7), main="likelihood surface for uniform")
  > abline(v=3, h=5, col="red", lty=2)
  > points(f1$estimate[1], f1$estimate[2], pch="x", col="violet")
  > points(f2$estimate[1], f2$estimate[2], pch="o", col="blue")
  > 
  > # (2) uniform distribution fit - fixed value
  > 
  > f3 <- fitdist(x1, "unif", fix.arg=list(min=2.5))
  > logLik(f3)
  [1] -7.983315
  > 
  > llcurve(x1, "unif", plot.arg="max", min.arg = 5-delta, max.arg=7)
  > 
  > f4 <- fitdist(x1, "unif", fix.arg=list(max=5.5))
  > logLik(f4)
  [1] -9.086651
  > 
  > 
  > # (3) four parameter beta - also known as PERT distribution
  > require(mc2d)
  Loading required package: mc2d
  Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'mc2d'
  > 
  > x2 <- rpert(2*nsample, 0, 1, 2, 3)
  Error in rpert(2 * nsample, 0, 1, 2, 3) : could not find function "rpert"
  Execution halted