BMTfit: Fit of the BMT Distribution to Non-censored Data.

Description Usage Arguments Details Value Author(s) Source References See Also Examples

View source: R/BMTfit.R

Description

Fit of the BMT distribution to non-censored data by maximum likelihood (mle), moment matching (mme), quantile matching (qme), maximum goodness-of-fit (mge), also known as minimum distance, maximum product of spacing (mpse), also called maximum spacing, and minimum quantile distance (mqde), which can also be called maximum quantile goodness-of-fit.

Usage

1
2
3
4
5
BMTfit(data, method = c("mle", "mme", "qme", "mge", "mpse", "mqde"),
  start = list(p3 = 0.5, p4 = 0.5, p1 = min(data) - 0.1, p2 = max(data) +
  0.1), fix.arg = NULL, type.p.3.4 = "t w", type.p.1.2 = "c-d",
  optim.method = "Nelder-Mead", custom.optim = NULL, keepdata = TRUE,
  keepdata.nb = 100, ...)

Arguments

data

A numeric vector with the observed values for non-censored data.

method

A character string coding for the fitting method: "mle" for 'maximum likelihood estimation', "mme" for 'moment matching estimation', "qme" for 'quantile matching estimation', "mge" for 'maximum goodness-of-fit estimation', "mpse" for 'maximum product of spacing estimation', and "mqde" for 'minimum quantile estimation'.

start

A named list giving the initial values of parameters of the BMT distribution or a function of data computing initial values and returning a named list. (see the 'details' section of mledist).

fix.arg

An optional named list giving the values of fixed parameters of the BMT distribution or a function of data computing (fixed) parameter values and returning a named list. Parameters with fixed value are thus NOT estimated. (see the 'details' section of mledist).

type.p.3.4

Type of parametrization asociated to p3 and p4. "t w" means tails weights parametrization (default) and "a-s" means asymmetry-steepness parametrization.

type.p.1.2

Type of parametrization asociated to p1 and p2. "c-d" means domain parametrization (default) and "l-s" means location-scale parametrization.

optim.method

"default" (see the 'details' section of mledist) or optimization method to pass to optim.

custom.optim

A function carrying the optimization (see the 'details' section of mledist).

keepdata

A logical. If TRUE, dataset is returned, otherwise only a sample subset is returned.

keepdata.nb

When keepdata=FALSE, the length (>1) of the subset returned.

...

Further arguments to be passed to generic functions, or to one of the functions "BMTfit.mle", "BMTfit.mme", "BMTfit.qme", "BMTfit.mge", "BMTfit.mpse", or "BMTfit.mqde" depending of the chosen method. See BMTfit.mle, BMTfit.mme, BMTfit.qme, BMTfit.mge, BMTfit.mpse, BMTfit.mqde for details on parameter estimation.

Details

This function is based on the function fitdist from the package fitdistrplus but it focuses on the parameter estimation for the BMT distribution (see BMT for details). It has six possible fitting methods: maximum likelihood (mle), moment matching (mme), quantile matching (qme), maximum goodness-of-fit (mge), also known as minimum distance, maximum product of spacing (mpse), also called maximum spacing, and minimum quantile distance (mqde), which can also be called maximum quantile goodness-of-fit. These fitting methods are carried out in BMTfit.mle, BMTfit.mme, BMTfit.qme, BMTfit.mge, BMTfit.mpse, and BMTfit.mqde, respectively (see each function for details). BMTfit returns an object of class "fitdist" (see fitdist for details). Therefore, it benefits of all the developed functions and methods for that class (see fitdistrplus for details).

Generic methods of a fitdist object are print, plot, summary, quantile, logLik, vcov and coef.

Value

fitdist returns an object of class "fitdist" with the following components:

estimate

the parameter estimates.

method

the character string coding for the fitting method : "mle" for 'maximum likelihood estimation', "mme" for 'moment matching estimation', "qme" for 'quantile matching estimation', "mge" for 'maximum goodness-of-fit estimation', "mpse" for 'maximum product of spacing estimation', and "mqde" for 'minimum quantile estimation'.

sd

the estimated standard errors, NA if numerically not computable or NULL if not available.

cor

the estimated correlation matrix, NA if numerically not computable or NULL if not available.

vcov

the estimated variance-covariance matrix, NULL if not available.

loglik

the log-likelihood.

aic

the Akaike information criterion.

bic

the the so-called BIC or SBC (Schwarz Bayesian criterion).

n

the length of the data set.

data

the data set.

distname

the name of the distribution (BMT).

fix.arg

the named list giving the values of parameters of the named distribution that must be kept fixed rather than estimated or NULL if there are no such parameters.

fix.arg.fun

the function used to set the value of fix.arg or NULL.

discrete

the input argument or the automatic definition by the function to be passed to functions gofstat, plotdist and cdfcomp.

dots

the list of further arguments passed in ... to be used in bootdist in iterative calls to mledist, mmedist, qmedist, mgedist, mpsedist, mqdedist or NULL if no such arguments.

weights

the vector of weigths used in the estimation process or NULL.

Author(s)

Camilo Jose Torres-Jimenez [aut,cre] [email protected]

Source

Based on the function fitdist of the R package: fitdistrplus

Delignette-Muller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 1-34.

References

Torres-Jimenez, C. J. (2017, September), Comparison of estimation methods for the BMT distribution. ArXiv e-prints.

Torres-Jimenez, C. J. (2018), The BMT Item Response Theory model: A new skewed distribution family with bounded domain and an IRT model based on it, PhD thesis, Doctorado en ciencias - Estadistica, Universidad Nacional de Colombia, Sede Bogota.

See Also

See BMT for the BMT density, distribution, quantile function and random deviates. See BMTfit.mle, BMTfit.mme, BMTfit.qme, BMTfit.mge, BMTfit.mpse and BMTfit.mqde for details on parameter estimation. See fitdist for details on the object fitdist and its methods print, plot, summary, quantile, logLik, vcov and coef, and fitdistrplus for an overview of the package to which that object belongs to.

Examples

 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
42
43
44
45
46
47
48
49
50
51
# (1) fit of the BMT distribution by maximum likelihood estimation
data(groundbeef)
serving <- groundbeef$serving
fit.mle <- BMTfit(serving)
summary(fit.mle)
plot(fit.mle)
plot(fit.mle, demp = TRUE)
plot(fit.mle, histo = FALSE, demp = TRUE)
cdfcomp(fit.mle, addlegend=FALSE)
denscomp(fit.mle, addlegend=FALSE)
ppcomp(fit.mle, addlegend=FALSE)
qqcomp(fit.mle, addlegend=FALSE)

# (2) Comparison of various estimation methods
fit.mme <- BMTfit(serving, method="mme")
fit.mpse <- BMTfit(serving, method="mpse")
fit.mqde <- BMTfit(serving, method="mqde")
summary(fit.mme)
summary(fit.mpse)
summary(fit.mqde)
cdfcomp(list(fit.mle, fit.mme, fit.mpse, fit.mqde), 
        legendtext=c("mle", "mme", "mpse", "mqde"))
denscomp(list(fit.mle, fit.mme, fit.mpse, fit.mqde), 
         legendtext=c("mle", "mme", "mpse", "mqde"))
qqcomp(list(fit.mle, fit.mme, fit.mpse, fit.mqde), 
       legendtext=c("mle", "mme", "mpse", "mqde"))
ppcomp(list(fit.mle, fit.mme, fit.mpse, fit.mqde), 
       legendtext=c("mle", "mme", "mpse", "mqde"))
gofstat(list(fit.mle, fit.mme, fit.mpse, fit.mqde), 
        fitnames=c("mle", "mme", "mpse", "mqde"))

# (3) how to change the optimisation method?
BMTfit(serving, optim.method="Nelder-Mead")
BMTfit(serving, optim.method="L-BFGS-B") 
BMTfit(serving, custom.optim="nlminb")

# (4) estimation of the tails weights parameters of the BMT distribution 
# with domain fixed at [9,201] using Kolmogorov-Smirnov
fit.KS <- BMTfit(serving, method="mge", gof="KS", 
                 start=list(p3=0.5, p4=0.5), fix.arg=list(p1=9, p2=201))
summary(fit.KS)
plot(fit.KS)

# (5) estimation of the asymmetry-steepness parameters of the BMT 
# distribution with domain fixed at [9,201] using minimum quantile distance 
# with a closed formula (optim.method="CD")
fit.mqde.CD <- BMTfit(serving, method="mqde", optim.method="CD", 
                      start=list(p3=0.5, p4=0.5), type.p.3.4 = "a-s", 
                      fix.arg=list(p1=9, p2=201))
summary(fit.mqde.CD)
plot(fit.mqde.CD)

BMT documentation built on Sept. 19, 2017, 9:02 a.m.