R Under development (unstable) (2024-02-22 r85974 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 0.9857856 0.9857856 time 0.0000000 0.0100000 > benchonestep(x, "exp", c("mm", "one")) mme onestep rate 0.9857856 0.9857856 time 0.0000000 0.0000000 > > > #### 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 3.102058 3.125098 shape2 1.968729 1.985666 time 0.000000 0.040000 > benchonestep(x, "beta", c("mle", "one")) mle onestep shape1 3.125098 3.124751 shape2 1.985666 1.985502 time 0.030000 0.000000 > > proc.time() user system elapsed 1.09 0.10 1.14