The argument distr can be one of the base R distributions: "norm", "lnorm",
"exp" and "pois", "gamma", "logis",
"nbinom" , "geom", "beta" and "unif".
In that case, no other arguments than data and distr are
required, because the estimate is computed by a closed-form formula.
For distributions characterized by one parameter ("geom", "pois" and "exp"),
this parameter is simply estimated by matching theoretical and observed means, and for distributions
characterized by two parameters, these parameters are estimated by matching theoretical and observed
means and variances (Vose, 2000).
Note that for these closed-form formula, fix.arg cannot be used and start is ignored.
The argument distr can also be the distribution name
as long as a corresponding mdistr function exists, e.g. "pareto" if "mpareto" exists.
In that case arguments arguments order and memp
have to be supplied in order to carry out the matching numerically, by minimization of the
sum of squared differences between observed and theoretical moments.
Optionnally other arguments can be supplied to control optimization (see the 'details' section of
mledist for details about arguments for the control of optimization).
In that case, fix.arg can be used and start is taken into account.
For non closed-form estimators, memp must be provided to compute empirical moments.
When weights=NULL, this function must have two arguments x, order:
x the numeric vector of the data and order the order of the moment.
When weights!=NULL, this function must have three arguments x, order, weights:
x the numeric vector of the data, order the order of the moment,
weights the numeric vector of weights. See examples below.
Optionally, a vector of weights can be used in the fitting process.
By default (when weigths=NULL), ordinary MME is carried out, otherwise
the specified weights are used to compute (raw or centered) weighted moments.
For closed-form estimators, weighted mean and variance are computed by
wtd.mean and wtd.var
from the Hmisc package. When a numerical minimization
is used, weighted are expected to be computed by the memp function.
It is not yet possible to take into account weighths in functions plotdist,
plotdistcens, plot.fitdist, plot.fitdistcens, cdfcomp,
cdfcompcens, denscomp, ppcomp, qqcomp, gofstat
and descdist
(developments planned in the future).
This function is not intended to be called directly but is internally called in
fitdist and bootdist when used with the matching moments method.