ct_fit_distribution: Fit a count distribution by maximum likelihood

View source: R/ct_plot_calendar.R

ct_fit_distributionR Documentation

Fit a count distribution by maximum likelihood

Description

Fits a Poisson, negative binomial, or binomial distribution to a vector of counts and returns the parameter estimates together with the log-likelihood, AIC and BIC.

Usage

ct_fit_distribution(count, distribution)

Arguments

count

Numeric vector of non-negative counts. For distribution = "binomial" it must contain only 0 and 1.

distribution

One of "poisson", "nbinomial" or "binomial".

Value

A one-row tibble with the fitted parameter(s), their standard error(s), the log-likelihood, AIC, BIC and sample size.

See Also

ct_plot_calendar()

Examples

set.seed(1)
ct_fit_distribution(stats::rpois(100, 3), "poisson")
ct_fit_distribution(stats::rnbinom(100, size = 1, mu = 4), "nbinomial")


ct documentation built on Oct. 22, 2026, 1:07 a.m.