Running 't-Beta.R' [2s]
  Running 't-Pareto.R' [2s]
  Running 't-benchonestep-4-closeform.R' [2s]
  Running 't-benchonestep-4-defensive.R' [2s]
  Running 't-benchonestep-replicate-4-closeform.R' [163s]
  Running 't-cauchy.R' [2s]
  Running 't-location-scaled-student.R' [2s]
  Running 't-onestep-4-closedform-defensive.R' [167s]
  Running 't-onestep-4-closedform.R' [166s]
  Running 't-onestep-4-control-arg.R' [3s]
  Running 't-onestep-4-numeric.R' [2s]
  Running 't-student.R' [161s]
  Running 't-weibull(2).R' [2s]
  Running 't-weibull.R' [174s]
Running the tests in 'tests/t-benchonestep-replicate-4-closeform.R' failed.
Complete output:
  > 
  > require(OneStep)
  Loading required package: OneStep
  Loading required package: fitdistrplus
  Loading required package: MASS
  Loading required package: survival
  Loading required package: numDeriv
  Loading required package: parallel
  Loading required package: extraDistr
  > 
  > 
  > n <- 1e3
  > 
  > ####   G1 <- c("norm", "exp", "lnorm", "invgauss", "pois", "geom") # Distributions for which the explicit MLE is returned ####   
  > 
  > 
  > benchonestep.replicate(n, 4, "exp", rate=1)
  , , simu1
  
                     mme         mle     onestep
  rate        0.97840039  0.97840039  0.97840039
  time        0.00000000  0.02000000  0.00000000
  error-rate -0.02159961 -0.02159961 -0.02159961
  
  , , simu2
  
                      mme         mle      onestep
  rate        0.998935679  0.99893568  0.998935679
  time        0.000000000  0.00000000  0.000000000
  error-rate -0.001064321 -0.00106432 -0.001064321
  
  , , simu3
  
                    mme        mle    onestep
  rate       1.01485475 1.01485475 1.01485475
  time       0.00000000 0.00000000 0.00000000
  error-rate 0.01485475 0.01485475 0.01485475
  
  , , simu4
  
                     mme         mle     onestep
  rate        0.96034856  0.96034857  0.96034856
  time        0.00000000  0.00000000  0.00000000
  error-rate -0.03965144 -0.03965143 -0.03965144
  
  > benchonestep.replicate(n, 4, "exp", rate=1, methods="mle")
  , , simu1
  
                    mle
  rate       1.01883975
  time       0.01000000
  error-rate 0.01883975
  
  , , simu2
  
                    mle
  rate       1.02064942
  time       0.00000000
  error-rate 0.02064942
  
  , , simu3
  
                     mle
  rate        0.95226747
  time        0.00000000
  error-rate -0.04773253
  
  , , simu4
  
                    mle
  rate       1.00253786
  time       0.00000000
  error-rate 0.00253786
  
  >   
  > 
  > 
  > 
  > 
  > ####   G3 <- c("gamma", "beta", "nbinom") # Distributions with a default MME initial guess estimator ####   
  > 
  > benchonestep.replicate(n, 4, "beta", shape1=1/2, shape2=3/2)
  , , simu1
  
                        mme          mle      onestep
  shape1        0.469875621  0.497601532  0.495926036
  shape2        1.490770043  1.549133329  1.545755209
  time          0.000000000  0.040000000  0.000000000
  error-shape1 -0.030124379 -0.002398468 -0.004073964
  error-shape2 -0.009229957  0.049133329  0.045755209
  
  , , simu2
  
                       mme         mle     onestep
  shape1        0.48016715  0.47747776  0.47742363
  shape2        1.36816746  1.36677446  1.36679310
  time          0.00000000  0.03000000  0.00000000
  error-shape1 -0.01983285 -0.02252224 -0.02257637
  error-shape2 -0.13183254 -0.13322554 -0.13320690
  
  , , simu3
  
                       mme         mle     onestep
  shape1        0.46841711  0.46387465  0.46381164
  shape2        1.33670462  1.34260442  1.34254509
  time          0.00000000  0.04000000  0.00000000
  error-shape1 -0.03158289 -0.03612535 -0.03618836
  error-shape2 -0.16329538 -0.15739558 -0.15745491
  
  , , simu4
  
                       mme          mle      onestep
  shape1        0.48631446  0.507733722  0.506730377
  shape2        1.38683402  1.455620944  1.452230543
  time          0.00000000  0.050000000  0.000000000
  error-shape1 -0.01368554  0.007733722  0.006730377
  error-shape2 -0.11316598 -0.044379056 -0.047769457
  
  > if(FALSE)
  +   benchonestep.replicate(n, 4, "beta", shape1=1/2, shape2=3/2, ncpus=2)
  > 
  > proc.time()
     user  system elapsed 
     1.59    0.18    1.76 
Running the tests in 'tests/t-onestep-4-closedform-defensive.R' failed.
Complete output:
  > 
  > require(OneStep)
  Loading required package: OneStep
  Loading required package: fitdistrplus
  Loading required package: MASS
  Loading required package: survival
  Loading required package: numDeriv
  Loading required package: parallel
  Loading required package: extraDistr
  > 
  > n <- 1e3
  > x <- rexp(n)
  > 
  > try(onestep(matrix(x, 4, n/4), "exp"))
  Error in onestep(matrix(x, 4, n/4), "exp") : 
    data must be a numeric vector of length greater than 1
  > 
  > try(onestep(x[1], "exp"))
  Error in onestep(x[1], "exp") : 
    data must be a numeric vector of length greater than 1
  > 
  > try(onestep(x, "exp", method="jaimeleraisindetable"))
  Error in match.arg(method, c("closed formula", "numeric")) : 
    'arg' should be one of "closed formula", "numeric"
  > 
  > try(onestep(x, "jaimeleraisindetable"))
  Error in onestep(x, "jaimeleraisindetable") : 
    The  djaimeleraisindetable  function must be defined
  > 
  > try(onestep(x, "exp", init=list(jaimeleraisindetable=1)))
  Error in checkparamlist(start.arg = init, fix.arg = NULL, argdistname = argddistname,  : 
    'init' must specify names which are arguments to 'distr'.
  > 
  > try(onestep(x, "exp", init=list(rate=1)))    
  Parameters:
       estimate
  rate 1.011405
  Warning message:
  In onestep_closedformula(obs = obs, distname = distname, control = con,  :
    The initial estimate is not taken into account for this distribution
  > 
  > try(onestep(x, "gamma", init=list(rate=1)))    
  Error in checkparamlist(start.arg = init, fix.arg = NULL, argdistname = argddistname,  : 
    Some parameter names have no initial value: shape, scale.
  > 
  > try(onestep(x, "gamma", init=list(shape=1)))    
  Error in checkparamlist(start.arg = init, fix.arg = NULL, argdistname = argddistname,  : 
    Some parameter names have no initial value: rate, scale.
  > 
  > proc.time()
     user  system elapsed 
     1.28    0.10    1.35 
Running the tests in 'tests/t-onestep-4-closedform.R' failed.
Complete output:
  > 
  > require(OneStep)
  Loading required package: OneStep
  Loading required package: fitdistrplus
  Loading required package: MASS
  Loading required package: survival
  Loading required package: numDeriv
  Loading required package: parallel
  Loading required package: extraDistr
  > require(actuar)
  Loading required package: actuar
  
  Attaching package: 'actuar'
  
  The following objects are masked from 'package:extraDistr':
  
      dgumbel, dinvgamma, dpareto, pgumbel, pinvgamma, ppareto, qgumbel,
      qinvgamma, qpareto, rgumbel, rinvgamma, rpareto
  
  The following objects are masked from 'package:stats':
  
      sd, var
  
  The following object is masked from 'package:grDevices':
  
      cm
  
  > 
  > n <- 1e3
  > 
  > ####   G1 <- c("norm", "exp", "lnorm", "invgauss", "pois", "geom") # Distributions for which the explicit MLE is returned ####   
  > 
  > x <- rexp(n)
  > os <- onestep(x, "exp")
  > summary(os)
  Parameters : 
       estimate
  rate 1.005625
  Loglikelihood:  -994.3906   AIC:  1990.781   BIC:  1995.689 
  > print(os)
  Parameters:
       estimate
  rate 1.005625
  > class(os)
  [1] "onestep" "fitdist"
  > plot(os)
  > 
  > x <- rlnorm(n, 0, 1)
  > os <- onestep(x, "lnorm", method="closed")
  > summary(os)
  Parameters : 
             estimate
  meanlog -0.05738316
  sdlog    0.99502526
  Loglikelihood:  -1356.568   AIC:  2717.136   BIC:  2726.952 
  > plot(os)
  > 
  > ####   G2 <- c("unif", "logis") # Special distributions ####   
  > 
  > x <- runif(n)
  > os <- onestep(x, "unif")
  > summary(os)
  Parameters : 
      estimate
  1 0.01796376
  2 1.02069529
  Loglikelihood:  -Inf   AIC:  Inf   BIC:  Inf 
  > le <- fitdist(x, "unif")
  > summary(le)
  Fitting of the distribution ' unif ' by maximum likelihood 
  Parameters : 
          estimate Std. Error
  min 0.0004435426         NA
  max 0.9985896826         NA
  Loglikelihood:  1.855581   AIC:  0.288839   BIC:  10.10435 
  Correlation matrix:
  [1] NA
  
  > 
  > 
  > x <- rlogis(n)
  > os <- onestep(x, "logis")
  > summary(os)
  Parameters : 
             estimate
  location 0.01819677
  scale    0.99182390
  Loglikelihood:  -1997.726   AIC:  3999.452   BIC:  4009.267 
  > le <- fitdist(x, "logis")
  > summary(le)
  Fitting of the distribution ' logis ' by maximum likelihood 
  Parameters : 
             estimate Std. Error
  location 0.00295333 0.05487402
  scale    0.99994242 0.02638748
  Loglikelihood:  -1997.637   AIC:  3999.274   BIC:  4009.089 
  Correlation matrix:
              location       scale
  location 1.000000000 0.001526797
  scale    0.001526797 1.000000000
  
  > 
  > 
  > ####   G3 <- c("gamma", "beta", "nbinom") # Distributions with a default MME initial guess estimator ####   
  > 
  > x <- rbeta(n, 3, 2)
  > os <- onestep(x, "beta")
  > summary(os)
  Parameters : 
         estimate
  shape1 3.187229
  shape2 2.119558
  Loglikelihood:  256.0652   AIC:  -508.1305   BIC:  -498.315 
  > os <- onestep(x, "beta", init=list(shape1=1, shape2=1))
  > 
  > x <- rgamma(n, 3, 2)
  > os <- onestep(x, "gamma", init=list(shape=1, scale=1))
  > summary(os)
  Parameters : 
        estimate
  shape 1.483460
  rate  1.008175
  Loglikelihood:  -1252.547   AIC:  2509.094   BIC:  2518.909 
  > os <- onestep(x, "gamma", init=list(shape=10, rate=1))
  Warning message:
  In dgamma(c(2.22291830433137, 1.51493716362082, 0.992885203820308,  :
    NaNs produced
  > summary(os)
  Parameters : 
          estimate
  shape -220.22359
  rate   -21.16989
  Loglikelihood:  NaN   AIC:  NaN   BIC:  NaN 
  > 
  > x <- rnbinom(n, 3, 1/3) #mu=size*(1-prob)/prob=6
  > os <- onestep(x, "nbinom")
  > summary(os)
  Parameters : 
       estimate
  size 3.246902
  mu   6.010000
  Loglikelihood:  -2717.65   AIC:  5439.299   BIC:  5449.115 
  > os <- onestep(x, "nbinom", init=list(size=10, mu=2))
  > summary(os)
  Parameters : 
        estimate
  size 12.926326
  mu    3.259469
  Loglikelihood:  -3541.107   AIC:  7086.213   BIC:  7096.029 
  > os <- onestep(x, "nbinom", init=list(size=10, prob=1/2))
  > summary(os)
  Parameters : 
       estimate
  size 2.398741
  mu   3.839231
  Loglikelihood:  -2909.872   AIC:  5823.745   BIC:  5833.56 
  > 
  > 
  > 
  > 
  > ####   G4 <- c("cauchy", "weibull", "pareto") # Distributions with a special initial guess estimator ####   
  > 
  > x <- rweibull(n, 3, 2)
  > os <- onestep(x, "weibull")
  > summary(os)
  Parameters : 
        estimate
  shape 2.956715
  scale 1.998819
  Loglikelihood:  -984.2341   AIC:  1972.468   BIC:  1982.284 
  > os <- onestep(x, "weibull", init=list(shape=1, scale=1))
  > summary(os)
  Parameters : 
         estimate
  shape  1.410436
  scale 23.515693
  Loglikelihood:  -3931.801   AIC:  7867.602   BIC:  7877.417 
  > 
  > 
  > x <- rcauchy(n, 1, 2)
  > os <- onestep(x, "cauchy", control=list(param_t=1/4))
  > summary(os)
  Parameters : 
            estimate
  location 0.9375791
  scale    2.0372432
  Loglikelihood:  -3204.372   AIC:  6412.744   BIC:  6422.56 
  > os <- onestep(x, "cauchy", init=list(location=0, scale=1))
  > summary(os)
  Parameters : 
            estimate
  location 0.3480683
  scale    1.8029589
  Loglikelihood:  -3230.509   AIC:  6465.018   BIC:  6474.833 
  > 
  > 
  > x <- rpareto(n, 1, 2)
  > os <- onestep(x, "pareto")
  > summary(os)
  Parameters : 
         estimate
  shape 0.8316559
  scale 1.3307617
  Loglikelihood:  -2672.556   AIC:  5349.111   BIC:  5358.927 
  > os <- onestep(x, "pareto", init=list(shape=1, scale=1))
  > summary(os)
  Parameters : 
         estimate
  shape 0.6416288
  scale 1.0133143
  Loglikelihood:  -2685.014   AIC:  5374.029   BIC:  5383.844 
  > 
  > proc.time()
     user  system elapsed 
     1.73    0.21    1.93 
Running the tests in 'tests/t-student.R' failed.
Complete output:
  > 
  > require(OneStep)
  Loading required package: OneStep
  Loading required package: fitdistrplus
  Loading required package: MASS
  Loading required package: survival
  Loading required package: numDeriv
  Loading required package: parallel
  Loading required package: extraDistr
  > 
  > n <- 1e3
  > 
  > #### standard student distribution ####
  > 
  > theta <- c("df"=3/2, "ncp"=0)
  > o.sample <- rt(n, df = theta["df"], ncp = theta["ncp"])
  > 
  > mledist(o.sample, "t", start=list("df"=2), fix.arg=list("ncp"=0))
  $estimate
        df 
  1.501411 
  
  $convergence
  [1] 0
  
  $value
  [1] 2158.526
  
  $hessian
           df
  df 143.8509
  
  $optim.function
  [1] "optim"
  
  $optim.method
  [1] "BFGS"
  
  $fix.arg
  $fix.arg$ncp
  [1] 0
  
  
  $fix.arg.fun
  NULL
  
  $weights
  NULL
  
  $counts
  function gradient 
        19        6 
  
  $optim.message
  NULL
  
  $loglik
  [1] -2158.526
  
  > onestep(o.sample, "t", control=list(delta=0.3))
  Parameters:
     estimate
  df 1.500379
  > onestep(o.sample, "t", control=list(delta=0.75))
  Parameters:
     estimate
  df 1.501414
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.29    0.31    1.57 
Running the tests in 'tests/t-weibull.R' failed.
Complete output:
  > 
  > 
  > require(OneStep)
  Loading required package: OneStep
  Loading required package: fitdistrplus
  Loading required package: MASS
  Loading required package: survival
  Loading required package: numDeriv
  Loading required package: parallel
  Loading required package: extraDistr
  > 
  > n <- 1e3
  > set.seed(1)
  > theta <- c(0.8,3)
  > o.sample <- rweibull(n,shape = theta[1], scale = 1/theta[2])
  > 
  > onestep(o.sample, "weibull")
  Parameters:
         estimate
  shape 0.8027735
  scale 0.3293578
  > 
  > proc.time()
     user  system elapsed 
     1.40    0.18    1.59