Description Usage Arguments Details Value Author(s) Source References See Also Examples
Fit of univariate distributions for noncensored data using minimum quantile distance estimation (mqde), which can also be called maximum quantile goodnessoffit estimation.
1 2 3 4 5 
data 
A numeric vector with the observed values for noncensored data. 
distr 
A character string 
probs 
A numeric vector of the probabilities for which the minimum quantile distance estimation is done. p[k] = (k  0.5) / n (default). 
qtype 
The quantile type used by the R 
dist 
The distance measure between observed and theoretical quantiles to be used. This must be one of "euclidean" (default), "maximum", or "manhattan". Any unambiguous substring can be given. 
start 
A named list giving the initial values of parameters of the
named distribution or a function of data computing initial values and
returning a named list. This argument may be omitted (default) for some
distributions for which reasonable starting values are computed (see the
'details' section of 
fix.arg 
An optional named list giving the values of fixed parameters of the named distribution or a function of data computing (fixed) parameter values and returning a named list. Parameters with fixed value are thus NOT estimated. 
optim.method 

lower 
Left bounds on the parameters for the 
upper 
Right bounds on the parameters for the 
custom.optim 
A function carrying the optimization (see details). 
weights 
An optional vector of weights to be used in the fitting
process. Should be 
silent 
A logical to remove or show warnings when bootstraping. 
gradient 
A function to return the gradient of the optimization
objective function for the 
... 
Further arguments passed to the 
The mqdedist
function carries out the minimum quantile
distance estimation numerically, by minimization of a distance between
observed and theoretical quantiles.
The optimization process is the same as
mledist
, see the 'details' section of that
function.
Optionally, a vector of weights
can be used in the fitting process.
By default (when weigths=NULL
), ordinary mqde is carried out,
otherwise the specified weights are used to compute a weighted distance.
We believe this function should be added to the package
fitdistrplus
. Until it is accepted and incorporated into that
package, it will remain in the package BMT
. This function is
internally called in BMTfit.mqde
.
mqdedist
returns a list with following components,
estimate 
the parameter estimates. 
convergence 
an integer code for the convergence of

value 
the value of the optimization objective function at the solution found. 
hessian 
a symmetric matrix computed by 
probs 
the probability vector on which observed and theoretical quantiles were calculated. 
dist 
the name of the distance between observed and theoretical quantiles used. 
optim.function 
the name of the optimization function used. 
fix.arg 
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated by maximum
likelihood or 
loglik 
the loglikelihood. 
optim.method 
when 
fix.arg.fun 
the function used to set the value of 
weights 
the vector of weigths used in the estimation process or

counts 
A twoelement integer vector giving the number of calls to
the loglikelihood function and its gradient respectively. This excludes
those calls needed to compute the Hessian, if requested, and any calls to
loglikelihood function to compute a finitedifference approximation to the
gradient. 
optim.message 
A character string giving any additional information
returned by the optimizer, or 
Camilo Jose TorresJimenez [aut,cre] cjtorresj@unal.edu.co
Based on the function mledist of the R package: fitdistrplus
DelignetteMuller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 134.
Functions checkparam
and start.arg.default
are needed and
were copied from the same package (fitdistrplus version: 1.09).
LaRiccia, V. N. (1982). Asymptotic Properties of Weighted $L^2$ Quantile Distance Estimators. The Annals of Statistics, 10(2), 621624.
TorresJimenez, C. J. (2017, September), Comparison of estimation methods for the BMT distribution. ArXiv eprints.
mpsedist
, mledist
,
mmedist
, qmedist
,
mgedist
, optim
,
constrOptim
, and quantile
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  # (1) basic fit of a normal distribution
set.seed(1234)
x1 < rnorm(n = 100)
mean(x1); sd(x1)
mqde1 < mqdedist(x1, "norm")
mqde1$estimate
# (2) defining your own distribution functions, here for the Gumbel
# distribution for other distributions, see the CRAN task view dedicated
# to probability distributions
dgumbel < function(x, a, b) 1/b*exp((ax)/b)*exp(exp((ax)/b))
pgumbel < function(q, a, b) exp(exp((aq)/b))
qgumbel < function(p, a, b) ab*log(log(p))
mqde1 < mqdedist(x1, "gumbel", start = list(a = 10, b = 5))
mqde1$estimate
# (3) fit a discrete distribution (Poisson)
set.seed(1234)
x2 < rpois(n = 30, lambda = 2)
mqde2 < mqdedist(x2, "pois")
mqde2$estimate
# (4) fit a finitesupport distribution (beta)
set.seed(1234)
x3 < rbeta(n = 100, shape1 = 5, shape2 = 10)
mqde3 < mqdedist(x3, "beta")
mqde3$estimate
# (5) fit frequency distributions on USArrests dataset.
x4 < USArrests$Assault
mqde4pois < mqdedist(x4, "pois")
mqde4pois$estimate
mqde4nbinom < mqdedist(x4, "nbinom")
mqde4nbinom$estimate
# (6) weighted fit of a normal distribution
set.seed(1234)
w1 < runif(100)
weighted.mean(x1, w1)
mqde1 < mqdedist(x1, "norm", weights = w1)
mqde1$estimate

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.