R Under development (unstable) (2024-10-16 r87241 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. > > 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) > benchonestep(x, "exp", c("mme", "mle")) mme mle rate 1.05823 1.05823 time 0.00000 0.02000 > benchonestep(x, "exp", c("mm", "one")) mme onestep rate 1.05823 1.05823 time 0.00000 0.00000 > > > #### G3 <- c("gamma", "beta", "nbinom") # Distributions with a default MME initial guess estimator #### > > x <- rbeta(n, 3, 2) > benchonestep(x, "beta", c("mme", "mle")) mme mle shape1 2.971650 2.945404 shape2 1.897694 1.874304 time 0.000000 0.030000 > benchonestep(x, "beta", c("mle", "one")) mle onestep shape1 2.945404 2.945049 shape2 1.874304 1.874045 time 0.030000 0.010000 > > proc.time() user system elapsed 1.59 0.28 1.85