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 > > > 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.97419077 0.97419077 0.97419077 time 0.00000000 0.01000000 0.00000000 error-rate -0.02580923 -0.02580923 -0.02580923 , , simu2 mme mle onestep rate 0.97013708 0.97013709 0.97013708 time 0.00000000 0.00000000 0.00000000 error-rate -0.02986292 -0.02986291 -0.02986292 , , simu3 mme mle onestep rate 0.97959534 0.97959535 0.97959534 time 0.00000000 0.02000000 0.00000000 error-rate -0.02040466 -0.02040465 -0.02040466 , , simu4 mme mle onestep rate 1.0535006 1.0535006 1.0535006 time 0.0000000 0.0000000 0.0000000 error-rate 0.0535006 0.0535006 0.0535006 > benchonestep.replicate(n, 4, "exp", rate=1, methods="mle") , , simu1 mle rate 0.97191726 time 0.00000000 error-rate -0.02808274 , , simu2 mle rate 0.97744489 time 0.00000000 error-rate -0.02255511 , , simu3 mle rate 0.92878237 time 0.00000000 error-rate -0.07121763 , , simu4 mle rate 1.03256371 time 0.00000000 error-rate 0.03256371 > > > > > > #### 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.48587911 0.47569196 0.47548075 shape2 1.43076431 1.39312198 1.39223447 time 0.00000000 0.03000000 0.00000000 error-shape1 -0.01412089 -0.02430804 -0.02451925 error-shape2 -0.06923569 -0.10687802 -0.10776553 , , simu2 mme mle onestep shape1 0.51154309 0.51330329 0.51333038 shape2 1.55776486 1.55806735 1.55799099 time 0.00000000 0.03000000 0.00000000 error-shape1 0.01154309 0.01330329 0.01333038 error-shape2 0.05776486 0.05806735 0.05799099 , , simu3 mme mle onestep shape1 0.52091777 0.505337912 0.504837239 shape2 1.58670549 1.539820443 1.538303822 time 0.00000000 0.020000000 0.000000000 error-shape1 0.02091777 0.005337912 0.004837239 error-shape2 0.08670549 0.039820443 0.038303822 , , simu4 mme mle onestep shape1 0.52548017 0.51752511 0.51729557 shape2 1.46466887 1.45220616 1.45180496 time 0.00000000 0.02000000 0.00000000 error-shape1 0.02548017 0.01752511 0.01729557 error-shape2 -0.03533113 -0.04779384 -0.04819504 > if(FALSE) + benchonestep.replicate(n, 4, "beta", shape1=1/2, shape2=3/2, ncpus=2) > > proc.time() user system elapsed 1.26 0.17 1.42