prefit(data, distr, method = c("mle", "mme", "qme", "mge"), feasible.par, memp=NULL, order=NULL, probs=NULL, qtype=7, gof=NULL, fix.arg=NULL, lower, upper, weights=NULL, silent=TRUE, ...)"name" naming a distribution for which the corresponding
density function dname, the corresponding distribution function pname and the
corresponding quantile function qname must be defined, or directly the density function."mle" for 'maximum likelihood estimation', "mme" for 'moment matching estimation',
"qme" for 'quantile matching estimation' and "mge" for 'maximum goodness-of-fit estimation'.mledist).
It may not be into account for closed-form formulas.distr argument (and weights argument).quantile function to
compute the empirical quantiles, (default 7 corresponds to the default quantile method in R).method="mme" and a closed-form formula is used.NULL or a numeric vector. If non-NULL,
weighted MLE is used, otherwise ordinary MLE.Searching good starting values is achieved by transforming the parameters (from their constraint interval to the real line) of the probability distribution. Indeed,
sd of a normal distribution, see Normal),
prob of a geometric distribution, see Geometric),
mean of a normal distribution, see Normal.
Once parameters are transformed, an optimization is carried out by a quasi-Newton algorithm (typically BFGS) and then we transform them back to original parameter value.
mledist, mmedist, qmedist,
mgedist for details on parameter estimation.
See fitdist for the main procedure.
# (1) fit of a gamma distribution by maximum likelihood estimation
#
x <- rgamma(1e3, 5/2, 7/2)
prefit(x, "gamma", "mle", list(shape=3, scale=3), lower=-Inf, upper=Inf)
Run the code above in your browser using DataLab