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 > > > 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.98502014 0.98502015 0.98502014 time 0.00000000 0.00000000 0.00000000 error-rate -0.01497986 -0.01497985 -0.01497986 , , simu2 mme mle onestep rate 0.91418049 0.91418049 0.91418049 time 0.00000000 0.02000000 0.00000000 error-rate -0.08581951 -0.08581951 -0.08581951 , , simu3 mme mle onestep rate 1.06321167 1.06321167 1.06321167 time 0.00000000 0.00000000 0.00000000 error-rate 0.06321167 0.06321167 0.06321167 , , simu4 mme mle onestep rate 0.98623116 0.98623116 0.98623116 time 0.00000000 0.00000000 0.00000000 error-rate -0.01376884 -0.01376884 -0.01376884 > benchonestep.replicate(n, 4, "exp", rate=1, methods="mle") , , simu1 mle rate 1.0129466 time 0.0000000 error-rate 0.0129466 , , simu2 mle rate 1.02219614 time 0.00000000 error-rate 0.02219614 , , simu3 mle rate 0.98294121 time 0.00000000 error-rate -0.01705879 , , simu4 mle rate 0.96306401 time 0.01000000 error-rate -0.03693599 > > > > > > #### 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.49316368 0.5004974912 0.500342076 shape2 1.61665072 1.6463939239 1.645661610 time 0.00000000 0.0300000000 0.000000000 error-shape1 -0.00683632 0.0004974912 0.000342076 error-shape2 0.11665072 0.1463939239 0.145661610 , , simu2 mme mle onestep shape1 0.508283456 0.52350546 0.52305671 shape2 1.553197607 1.60757294 1.60579519 time 0.000000000 0.03000000 0.00000000 error-shape1 0.008283456 0.02350546 0.02305671 error-shape2 0.053197607 0.10757294 0.10579519 , , simu3 mme mle onestep shape1 0.51425868 0.497904582 0.49730126 shape2 1.52980135 1.485907739 1.48431230 time 0.00000000 0.040000000 0.00000000 error-shape1 0.01425868 -0.002095418 -0.00269874 error-shape2 0.02980135 -0.014092261 -0.01568770 , , simu4 mme mle onestep shape1 0.51376341 0.507416395 0.507265959 shape2 1.63594056 1.604247909 1.603676088 time 0.00000000 0.030000000 0.010000000 error-shape1 0.01376341 0.007416395 0.007265959 error-shape2 0.13594056 0.104247909 0.103676088 > if(FALSE) + benchonestep.replicate(n, 4, "beta", shape1=1/2, shape2=3/2, ncpus=2) > > proc.time() user system elapsed 1.68 0.31 1.93