distrFit {cvmdisc}R Documentation

distrFit

Description

Finds the Maximum Likelihood Estimates of the parameters in a requested distribution.

Usage

distrFit(breaks, counts, distr, initials)

Arguments

breaks

Vector defining the breaks in each group

counts

Vector containing the frequency of counts in each group

distr

Character; the name of the distribution users want to fit the data to

distrFit supports all of the continuous distributions supported in groupFit:

initials

Vector of initial values for the maximum likelihood estimates.

Details

distFit uses Maximum Likelihood Estimates to optimize the parameters for a requested distribution.

Value

distFit returns a vector containing the MLEs.

Author(s)

Shaun Zheng Sun and Dillon Duncan

See Also

groupFit for fitting data and providing GoF statistics.

Examples


#fitting exponential data without initial values (Spinelli 2001)

breaks <- c(0, 2, 6, 10, 14, 18, 22, 26)
counts <- c(21, 9, 5, 2, 1, 1, 0)

(mle1 <- distrFit(breaks, counts, distr = "exp"))

#fitting generated data with initial values

breaks <- seq(0, 40, 2)
counts <- table(cut(rweibull(200, 0.5, 3), breaks))

(mle2 <- distrFit(breaks, counts, distr = "weibull", initials = c(0.5, 3)))

#fitting generated data to a different distribution

breaks <- seq(-100, 100, 5)
counts <- table(cut(rcauchy(500, -20, 10), breaks))

(mle3 <- distrFit(breaks, counts, distr = "norm"))


[Package cvmdisc version 0.1.0 Index]