Description Usage Arguments Details Value Author(s) See Also Examples
Finds the Maximum Likelihood Estimates of the parameters in a requested distribution.
1 | distrFit(breaks, counts, distr, initials)
|
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 |
initials |
Vector of initial values for the maximum likelihood estimates. |
distFit uses Maximum Likelihood Estimates to optimize the parameters for a requested distribution.
distFit returns a vector containing the MLEs.
Shaun Zheng Sun and Dillon Duncan
groupFit
for fitting data and providing GoF statistics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.