R Under development (unstable) (2024-07-10 r86888 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. > library(fitdistrplus) Loading required package: MASS Loading required package: survival > library(actuar) Attaching package: 'actuar' The following objects are masked from 'package:stats': sd, var The following object is masked from 'package:grDevices': cm > > set.seed(1234) > > n <- 1e3 > x <- rztpois(n, 2) > > fitdistrplus:::startarg_discrete_actuar_family(x, "ztpois") $lambda [1] 1.342 > fitdist(x, "ztpois") Fitting of the distribution ' ztpois ' by maximum likelihood Parameters: estimate Std. Error lambda 2.036363 0.05049732 > > > fitdistrplus:::startarg_discrete_actuar_family(x, "ztnbinom") $size [1] 4.490779 $prob [1] 0.769921 > fitdist(x, "ztnbinom") Fitting of the distribution ' ztnbinom ' by maximum likelihood Parameters: estimate Std. Error size 21.3021080 13.73917267 prob 0.9144173 0.04943426 > > > fitdistrplus:::startarg_discrete_actuar_family(x, "ztgeom") $prob [1] 0.4269855 > fitdist(x, "ztgeom") Fitting of the distribution ' ztgeom ' by maximum likelihood Parameters: estimate Std. Error prob 0.4269855 0.01022101 > > library(actuar) > x <- rztbinom(n, 30, 1/2) > > fitdistrplus:::startarg_discrete_actuar_family(x, "ztbinom") $size [1] 28 $prob [1] 0.5045262 > fitdist(x, "ztbinom", lower=0) Fitting of the distribution ' ztbinom ' by maximum likelihood Parameters: estimate size 28.0000000 prob 0.5307143 > > > proc.time() user system elapsed 1.71 0.34 2.03