mllgser: Logarithmic series distribution maximum likelihood estimation

mllgserR Documentation

Logarithmic series distribution maximum likelihood estimation

Description

For the density function of the Logarithmic series distribution see Logarithmic series. For an example data set, see corbet.

Usage

mllgser(x, na.rm = FALSE, ...)

Arguments

x

a (non-empty) numeric vector of data values.

na.rm

logical. Should missing values be removed?

...

Not in use.

Value

mllgser returns an object of class univariateML. This is a named numeric vector with maximum likelihood estimates for theta.

model

The name of the model.

density

The density associated with the estimates.

logLik

The loglikelihood at the maximum.

support

The support of the density.

n

The number of observations.

call

The call as captured my match.call

References

Fisher, R. A., Corbet, A. S., & Williams, C. B. (1943). The relation between the number of species and the number of individuals in a random sample of an animal population. The Journal of Animal Ecology, 12(1), 42. https://doi.org/10.2307/1411

Johnson, N. L., Kemp, A. W., & Kotz, S. (2005). Univariate Discrete Distributions (3rd ed.). Wiley-Blackwell.

See Also

Logarithmic series for the density.

Examples

theta_hat <- mllgser(corbet)

# The corbert data contains observations from 1 to 24.
observed <- table(corbet)

# The chi square test evaluated at the maximum likelihood is highly significant.
expected <- extraDistr::dlgser(1:24, theta_hat)
chisq.test(observed, p = expected / sum(expected))

# But chi square test evaluated at 0.997 (used in Corbet) is not.
expected <- extraDistr::dlgser(1:24, 0.997)
chisq.test(observed, p = expected / sum(expected))

# The chi square for `dzipf` is similar.
expected <- sads::dzipf(1:24, mlzipf(corbet)[1], mlzipf(corbet)[2]) * length(corbet)
chisq.test(observed, p = expected / sum(expected))

JonasMoss/univariateML documentation built on Nov. 3, 2024, 3:03 p.m.