Title: | The BMT Distribution |
---|---|
Description: | Density, distribution, quantile function, random number generation for the BMT (Bezier-Montenegro-Torres) distribution. Torres-Jimenez C.J. and Montenegro-Diaz A.M. (2017) <arXiv:1709.05534>. Moments, descriptive measures and parameter conversion for different parameterizations of the BMT distribution. Fit of the BMT distribution to non-censored data by maximum likelihood, moment matching, quantile matching, maximum goodness-of-fit, also known as minimum distance, maximum product of spacing, also called maximum spacing, and minimum quantile distance, which can also be called maximum quantile goodness-of-fit. Fit of univariate distributions for non-censored data using maximum product of spacing estimation and minimum quantile distance estimation is also included. |
Authors: | Camilo Jose Torres-Jimenez [aut,cre], Alvaro Mauricio Montenegro Diaz [ths] |
Maintainer: | Camilo Jose Torres-Jimenez <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0.3 |
Built: | 2024-11-05 04:27:33 UTC |
Source: | https://github.com/cran/BMT |
Density, distribution, quantile function, random number
generation for the BMT distribution, with p3
and p4
tails
weights ( and
) or asymmetry-steepness
parameters (
and
) and
p1
and p2
domain
(minimum and maximum) or location-scale (mean and standard deviation)
parameters.
dBMT(x, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", log = FALSE) pBMT(q, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", lower.tail = TRUE, log.p = FALSE) qBMT(p, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", lower.tail = TRUE, log.p = FALSE) rBMT(n, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
dBMT(x, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", log = FALSE) pBMT(q, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", lower.tail = TRUE, log.p = FALSE) qBMT(p, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", lower.tail = TRUE, log.p = FALSE) rBMT(n, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
x , q
|
vector of quantiles. |
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
The BMT distribution with tails weights and domain parametrization
(type.p.3.4 = "t w"
and type.p.1.2 = "c-d"
) has quantile
function
where ,
, and
and
are, respectively, related to left and right
tail weights or curvatures.
The BMT coefficient of asymmetry is
The BMT coefficient of steepness is
for
.
dBMT
gives the density, pBMT
the distribution function,
qBMT
the quantile function, and rBMT
generates random
deviates.
The length of the result is determined by n
for rBMT
, and is
the maximum of the lengths of the numerical arguments for the other
functions.
The numerical arguments other than n
are recycled to the length of
the result. Only the first elements of the logical arguments are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected] and Alvaro Mauricio Montenegro Diaz [ths]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: The BMT distribution. ArXiv e-prints.
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.
BMTcentral
, BMTdispersion
,
BMTskewness
, BMTkurtosis
,
BMTmoments
for descriptive measures or moments.
BMTchangepars
for parameter conversion between different
parametrizations.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 z <- seq(0, 1, length.out = 100) F1 <- pBMT(z, 0.25, 0.75, "t w") Q1 <- qBMT(F1, 0.25, 0.75, "t w") max(abs(z - Q1)) f1 <- dBMT(z, 0.25, 0.75, "t w") r1 <- rBMT(100, 0.25, 0.75, "t w") layout(matrix(c(1,2,1,3), 2, 2)) hist(r1, freq = FALSE, xlim = c(0,1)) lines(z, f1) plot(z, F1, type="l") plot(F1, Q1, type="l") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 F2 <- pBMT(z, 0.5, 0.5, "a-s") Q2 <- qBMT(F2, 0.5, 0.5, "a-s") f2 <- dBMT(z, 0.5, 0.5, "a-s") r2 <- rBMT(100, 0.5, 0.5, "a-s") max(abs(f1 - f2)) max(abs(F1 - F2)) max(abs(Q1 - Q2)) # BMT on [-1.783489, 3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 x <- seq(-1.783489, 3.312195, length.out = 100) F3 <- pBMT(x, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") Q3 <- qBMT(F3, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") max(abs(x - Q3)) f3 <- dBMT(x, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") r3 <- rBMT(100, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") layout(matrix(c(1,2,1,3), 2, 2)) hist(r3, freq = FALSE, xlim = c(-1.783489,3.312195)) lines(x, f3) plot(x, F3, type="l") plot(F3, Q3, type="l") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 f4 <- dBMT(x, 0.5, 0.5, "a-s", 0, 1, "l-s") F4 <- pBMT(x, 0.5, 0.5, "a-s", 0, 1, "l-s") Q4 <- qBMT(F4, 0.5, 0.5, "a-s", 0, 1, "l-s") r4 <- rBMT(100, 0.5, 0.5, "a-s", 0, 1, "l-s") max(abs(f3 - f4)) max(abs(F3 - F4)) max(abs(Q3 - Q4))
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 z <- seq(0, 1, length.out = 100) F1 <- pBMT(z, 0.25, 0.75, "t w") Q1 <- qBMT(F1, 0.25, 0.75, "t w") max(abs(z - Q1)) f1 <- dBMT(z, 0.25, 0.75, "t w") r1 <- rBMT(100, 0.25, 0.75, "t w") layout(matrix(c(1,2,1,3), 2, 2)) hist(r1, freq = FALSE, xlim = c(0,1)) lines(z, f1) plot(z, F1, type="l") plot(F1, Q1, type="l") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 F2 <- pBMT(z, 0.5, 0.5, "a-s") Q2 <- qBMT(F2, 0.5, 0.5, "a-s") f2 <- dBMT(z, 0.5, 0.5, "a-s") r2 <- rBMT(100, 0.5, 0.5, "a-s") max(abs(f1 - f2)) max(abs(F1 - F2)) max(abs(Q1 - Q2)) # BMT on [-1.783489, 3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 x <- seq(-1.783489, 3.312195, length.out = 100) F3 <- pBMT(x, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") Q3 <- qBMT(F3, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") max(abs(x - Q3)) f3 <- dBMT(x, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") r3 <- rBMT(100, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") layout(matrix(c(1,2,1,3), 2, 2)) hist(r3, freq = FALSE, xlim = c(-1.783489,3.312195)) lines(x, f3) plot(x, F3, type="l") plot(F3, Q3, type="l") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 f4 <- dBMT(x, 0.5, 0.5, "a-s", 0, 1, "l-s") F4 <- pBMT(x, 0.5, 0.5, "a-s", 0, 1, "l-s") Q4 <- qBMT(F4, 0.5, 0.5, "a-s", 0, 1, "l-s") r4 <- rBMT(100, 0.5, 0.5, "a-s", 0, 1, "l-s") max(abs(f3 - f4)) max(abs(F3 - F4)) max(abs(Q3 - Q4))
Density, distribution function, quantile function, random number
generation for the BMT-Phi distribution with mean equal to mean
and
standard deviation equal to sd
.
dBMT.Phi(x, mean = 0, sd = 1, log = FALSE) pBMT.Phi(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qBMT.Phi(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rBMT.Phi(n, mean = 0, sd = 1)
dBMT.Phi(x, mean = 0, sd = 1, log = FALSE) pBMT.Phi(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qBMT.Phi(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rBMT.Phi(n, mean = 0, sd = 1)
x , q
|
vector of quantiles. |
mean |
vector of means. |
sd |
vector of standard deviations. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
If mean
or sd
are not specified they assume the
default values of 0 and 1, respectively.
The BMT-Phi distribution is the BMT distribution with . The BMT-Phi cumulative distribution
function (cdf) is the closest BMT cdf to the normal cdf with the same mean and standard deviation.
dBMT.Phi
gives the density, pBMT.Phi
the distribution
function, qBMT.Phi
the quantile function, and rBMT.Phi
generates random deviates.
The length of the result is determined by n
for rBMT.Phi
, and
is the maximum of the lengths of the numerical arguments for the other
functions.
The numerical arguments other than n
are recycled to the length of
the result. Only the first elements of the logical arguments are used.
sd <= 0
is an error and returns NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
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.
Distributions for other standard distributions.
pBMT
for the BMT distribution and pBMT.Psi
for
the BMT-Psi distribution.
layout(matrix(1:4,2,2)) curve(pnorm(x), -4, 4, col = "red", lty = 2, ylab = "cdf") curve(pBMT.Phi(x), add = TRUE, col = "blue", lty = 3) legend("topleft", legend = c("norm(0,1)","BMT-Phi(0,1)"), bty = "n", col = c("red","blue"), lty = 2:3) curve(pnorm(x)-pBMT.Phi(x), -4, 4) curve(qnorm(x), col = "red", lty = 2, xlab = "p", ylab = "qf") curve(qBMT.Phi(x), add = TRUE, col = "blue", lty = 3) hist(rBMT.Phi(10000), freq = FALSE, breaks = seq(-4,4,0.25), border = "blue") curve(dnorm(x), add = TRUE, col = "red", lty = 2) curve(dBMT.Phi(x), add = TRUE, col = "blue", lty = 3)
layout(matrix(1:4,2,2)) curve(pnorm(x), -4, 4, col = "red", lty = 2, ylab = "cdf") curve(pBMT.Phi(x), add = TRUE, col = "blue", lty = 3) legend("topleft", legend = c("norm(0,1)","BMT-Phi(0,1)"), bty = "n", col = c("red","blue"), lty = 2:3) curve(pnorm(x)-pBMT.Phi(x), -4, 4) curve(qnorm(x), col = "red", lty = 2, xlab = "p", ylab = "qf") curve(qBMT.Phi(x), add = TRUE, col = "blue", lty = 3) hist(rBMT.Phi(10000), freq = FALSE, breaks = seq(-4,4,0.25), border = "blue") curve(dnorm(x), add = TRUE, col = "red", lty = 2) curve(dBMT.Phi(x), add = TRUE, col = "blue", lty = 3)
Density, distribution function, quantile function, random number
generation for the BMT-Psi distribution with mean equal to mean
and
standard deviation equal to sd
.
dBMT.Psi(x, mean = 0, sd = 1, log = FALSE) pBMT.Psi(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qBMT.Psi(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rBMT.Psi(n, mean = 0, sd = 1)
dBMT.Psi(x, mean = 0, sd = 1, log = FALSE) pBMT.Psi(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qBMT.Psi(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rBMT.Psi(n, mean = 0, sd = 1)
x , q
|
vector of quantiles. |
mean |
vector of means. |
sd |
vector of standard deviations. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
If mean
or sd
are not specified they assume the
default values of 0 and 1, respectively.
The BMT-Psi distribution is the BMT distribution with . The BMT-Psi cumulative distribution
function (cdf) is the closest BMT cdf to the logistic cdf with scale =
1 / d and d = 1.70174439 (Camilli, 1994, p. 295).
dBMT.Psi
gives the density, pBMT.Psi
the distribution
function, qBMT.Psi
the quantile function, and rBMT.Psi
generates random deviates.
The length of the result is determined by n
for rBMT.Psi
, and
is the maximum of the lengths of the numerical arguments for the other
functions.
The numerical arguments other than n
are recycled to the length of
the result. Only the first elements of the logical arguments are used.
sd <= 0
is an error and returns NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
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.
Camilli, G. (1994). Teacher's corner: origin of the scaling constant d= 1.7 in item response theory. Journal of Educational Statistics, 19(3), 293-295.
Distributions for other standard distributions.
pBMT
for the BMT distribution and pBMT.Phi
for
the BMT-Phi distribution.
layout(matrix(1:4, 2, 2)) curve(plogis(x, scale = 1 / 1.70174439), -4, 4, col = "red", lty = 2, ylab = "cdf") curve(pBMT.Psi(x), add = TRUE, col = "blue", lty = 3) legend("topleft", legend = c("logis(0, 1 / 1.70174439)","BMT-Psi(0,1)"), bty = "n", col = c("red","blue"), lty = 2:3) curve(plogis(x, scale = 1 / 1.70174439)-pBMT.Psi(x), -4, 4) curve(qlogis(x, scale = 1 / 1.70174439), col = "red", lty = 2, xlab = "p", ylab = "qf") curve(qBMT.Psi(x), add = TRUE, col = "blue", lty = 3) hist(rBMT.Psi(10000), freq = FALSE, breaks = seq(-4, 4, 0.25), border = "blue") curve(dlogis(x, scale = 1 / 1.70174439), add = TRUE, col = "red", lty = 2) curve(dBMT.Psi(x), add = TRUE, col = "blue", lty = 3)
layout(matrix(1:4, 2, 2)) curve(plogis(x, scale = 1 / 1.70174439), -4, 4, col = "red", lty = 2, ylab = "cdf") curve(pBMT.Psi(x), add = TRUE, col = "blue", lty = 3) legend("topleft", legend = c("logis(0, 1 / 1.70174439)","BMT-Psi(0,1)"), bty = "n", col = c("red","blue"), lty = 2:3) curve(plogis(x, scale = 1 / 1.70174439)-pBMT.Psi(x), -4, 4) curve(qlogis(x, scale = 1 / 1.70174439), col = "red", lty = 2, xlab = "p", ylab = "qf") curve(qBMT.Psi(x), add = TRUE, col = "blue", lty = 3) hist(rBMT.Psi(10000), freq = FALSE, breaks = seq(-4, 4, 0.25), border = "blue") curve(dlogis(x, scale = 1 / 1.70174439), add = TRUE, col = "red", lty = 2) curve(dBMT.Psi(x), add = TRUE, col = "blue", lty = 3)
Mean, median and mode for the BMT distribution, with p3
and p4
tails weights ( and
) or
asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or location-scale (mean and
standard deviation) parameters.
BMTmean(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTmedian(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTmode(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
BMTmean(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTmedian(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTmode(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
See References.
BMTmean
gives the mean, BMTmedian
the median and
BMTmode
the mode for the BMT distribution.
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
and type.p.1.2
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: 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.
BMTdispersion
, BMTskewness
,
BMTkurtosis
, BMTmoments
for other descriptive
measures or moments.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmean(0.25, 0.75, "t w") BMTmedian(0.25, 0.75, "t w") BMTmode(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTmean(0.5, 0.5, "a-s") BMTmedian(0.5, 0.5, "a-s") BMTmode(0.5, 0.5, "a-s") # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmean(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTmedian(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTmode(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTmean(0.5, 0.5, "a-s", 0, 1, "l-s") BMTmedian(0.5, 0.5, "a-s", 0, 1, "l-s") BMTmode(0.5, 0.5, "a-s", 0, 1, "l-s")
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmean(0.25, 0.75, "t w") BMTmedian(0.25, 0.75, "t w") BMTmode(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTmean(0.5, 0.5, "a-s") BMTmedian(0.5, 0.5, "a-s") BMTmode(0.5, 0.5, "a-s") # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmean(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTmedian(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTmode(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTmean(0.5, 0.5, "a-s", 0, 1, "l-s") BMTmedian(0.5, 0.5, "a-s", 0, 1, "l-s") BMTmode(0.5, 0.5, "a-s", 0, 1, "l-s")
Parameter conversion for different parameterizations for the BMT
distribution, with p3
and p4
tails weights (
and
) or asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or
location-scale (mean and standard deviation) parameters.
BMTchangepars(p3, p4, type.p.3.4 = "t w", p1 = NULL, p2 = NULL, type.p.1.2 = NULL)
BMTchangepars(p3, p4, type.p.3.4 = "t w", p1 = NULL, p2 = NULL, type.p.1.2 = NULL)
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
The BMT coefficient of asymmetry is
The BMT coefficient of steepness is
for
.
The BMT distribution has mean and standard deviation
From these equations, we can go back and forth with each parameterization.
BMTchangepars
reparametrizes p3
, p4
, p1
,
p2
according to the alternative parameterizations from the given
type.p.3.4
and type.p.1.2
. BMTchangepars
returns a
list with the alternative arguments to those received.
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
and type.p.1.2
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected] and Alvaro Mauricio Montenegro Diaz [ths]
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.
BMT
for the BMT density, distribution, quantile
function and random deviates.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 parameters <- BMTchangepars(0.25, 0.75, "t w") parameters # Parameters of the BMT in the asymmetry-steepness parametrization # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 parameters <- BMTchangepars(0.5, 0.5, "a-s", 0, 1, "l-s") parameters # Parameters of the BMT in the tail weight and domain parametrization
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 parameters <- BMTchangepars(0.25, 0.75, "t w") parameters # Parameters of the BMT in the asymmetry-steepness parametrization # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 parameters <- BMTchangepars(0.5, 0.5, "a-s", 0, 1, "l-s") parameters # Parameters of the BMT in the tail weight and domain parametrization
Variance, standard deviation and interquantile range for the BMT
distribution, with p3
and p4
tails weights (
and
) or asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or
location-scale (mean and standard deviation) parameters.
BMTvar(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTsd(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTiqr(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
BMTvar(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTsd(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTiqr(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
See References.
BMTvar
gives the variance, BMTsd
the standard deviation
and BMTiqr
the interquantile range for the BMT distribution.
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
and type.p.1.2
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: 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.
BMTcentral
, BMTskewness
,
BMTkurtosis
, BMTmoments
for other descriptive
measures or moments.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTvar(0.25, 0.75, "t w") BMTsd(0.25, 0.75, "t w") BMTiqr(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTvar(0.5, 0.5, "a-s") BMTsd(0.5, 0.5, "a-s") BMTiqr(0.5, 0.5, "a-s") # BMT on [-1.783489,3.312195] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTvar(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTsd(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTiqr(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTvar(0.5, 0.5, "a-s", 0, 1, "l-s") BMTsd(0.5, 0.5, "a-s", 0, 1, "l-s") BMTiqr(0.5, 0.5, "a-s", 0, 1, "l-s")
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTvar(0.25, 0.75, "t w") BMTsd(0.25, 0.75, "t w") BMTiqr(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTvar(0.5, 0.5, "a-s") BMTsd(0.5, 0.5, "a-s") BMTiqr(0.5, 0.5, "a-s") # BMT on [-1.783489,3.312195] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTvar(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTsd(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTiqr(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTvar(0.5, 0.5, "a-s", 0, 1, "l-s") BMTsd(0.5, 0.5, "a-s", 0, 1, "l-s") BMTiqr(0.5, 0.5, "a-s", 0, 1, "l-s")
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.
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, ...)
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, ...)
data |
A numeric vector with the observed values for non-censored data. |
method |
A character string coding for the fitting method: |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
keepdata |
A logical. If |
keepdata.nb |
When |
... |
Further arguments to be passed to generic functions, or to one
of the functions |
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
.
fitdist
returns an object of class "fitdist"
with the
following components:
estimate |
the parameter estimates. |
method |
the character string coding for the fitting method :
|
sd |
the estimated standard errors, |
cor |
the estimated correlation matrix, |
vcov |
the estimated variance-covariance matrix, |
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 |
fix.arg.fun |
the function used to set the value of |
discrete |
the input argument or the automatic definition by the
function to be passed to functions |
dots |
the list of further arguments passed in ... to be used in
|
weights |
the vector of weigths used in the estimation process or
|
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
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.
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 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.
# (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)
# (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)
Fit of the BMT distribution to non-censored data by maximum goodness-of-fit estimation (mge), also known as minimum distance estimation.
BMTfit.mge(data, gof = "CvM", 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, silent = TRUE, ...)
BMTfit.mge(data, gof = "CvM", 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, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
gof |
A character string coding for the name of the goodness-of-fit distance used : "CvM" for Cramer-von Mises distance,"KS" for Kolmogorov-Smirnov distance, "AD" for Anderson-Darling distance, "ADR", "ADL", "AD2R", "AD2L" and "AD2" for variants of Anderson-Darling distance described by Luceno (2006). |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
silent |
A logical to remove or show warnings when bootstraping. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the maximum goodness-of-fit
method.
BMTfit.mge
is based on the function mgedist
but it
focuses on the maximum goodness-of-fit parameter estimation for the BMT
distribution (see BMT
for details about the BMT distribution
and mgedist
for details about maximum goodness-of-fit fit of
univariate distributions).
BMTfit.mge
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
value |
the value of the corresponding objective function of the estimation method at the estimate. |
hessian |
a symmetric matrix computed by |
loglik |
the log-likelihood value. |
gof |
the code of the goodness-of-fit distance maximized. |
optim.function |
the name of the optimization function used for maximum product of spacing. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mgedist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.mme
,
BMTfit.qme
, BMTfit.mle
,
BMTfit.mpse
and BMTfit.mqde
for other estimation
methods. See optim
and constrOptim
for
optimization routines. See BMTfit
and fitdist
for functions that return an objetc of class "fitdist"
.
# (1) basic fit by maximum goodness-of-fit estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mge(x1) # (2) how to change the goodness-of-fit statistic/distance? BMTfit.mge(x1, gof="KS") BMTfit.mge(x1, gof="AD2R") # (3) how to change the optimisation method? BMTfit.mge(x1, optim.method="L-BFGS-B") BMTfit.mge(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mge(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mge(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
# (1) basic fit by maximum goodness-of-fit estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mge(x1) # (2) how to change the goodness-of-fit statistic/distance? BMTfit.mge(x1, gof="KS") BMTfit.mge(x1, gof="AD2R") # (3) how to change the optimisation method? BMTfit.mge(x1, optim.method="L-BFGS-B") BMTfit.mge(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mge(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mge(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
Fit of the BMT distribution to non-censored data by maximum likelihood estimation (mle).
BMTfit.mle(data, 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, silent = TRUE, ...)
BMTfit.mle(data, 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, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
silent |
A logical to remove or show warnings when bootstraping. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the maximum likelihood method.
BMTfit.mle
is based on the function mledist
from the
package fitdistrplus
but it focuses on the maximum likelihood
parameter estimation for the BMT distribution (see BMT
for
details about the BMT distribution and mledist
for details
about maximum likelihood fit of univariate distributions).
BMTfit.mle
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
loglik |
the log-likelihood value. |
hessian |
a symmetric matrix computed by |
optim.function |
the name of the optimization function used for maximum likelihood. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mledist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.mme
,
BMTfit.qme
, BMTfit.mge
,
BMTfit.mpse
and BMTfit.mqde
for other estimation
methods. See optim
and constrOptim
for
optimization routines. See BMTfit
and fitdist
for functions that return an objetc of class "fitdist"
.
# (1) basic fit by maximum likelihood estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mle(x1) # (2) how to change the optimisation method? BMTfit.mle(x1, optim.method="L-BFGS-B") BMTfit.mle(x1, custom.optim="nlminb") # (3) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mle(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (4) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mle(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
# (1) basic fit by maximum likelihood estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mle(x1) # (2) how to change the optimisation method? BMTfit.mle(x1, optim.method="L-BFGS-B") BMTfit.mle(x1, custom.optim="nlminb") # (3) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mle(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (4) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mle(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
Fit of the BMT distribution to non-censored data by moment matching (mme).
BMTfit.mme(data, 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, silent = TRUE, ...)
BMTfit.mme(data, 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, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
silent |
A logical to remove or show warnings when bootstraping. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the moment matching method.
BMTfit.mme
is based on the function mmedist
but it
focuses on the moment matching parameter estimation for the BMT distribution
(see BMT
for details about the BMT distribution and
mmedist
for details about moment matching fit of univariate
distributions).
For each parameter of the BMT distribution we choose a moment or measure.
Mean for p1
, standard deviation for p2
, Pearson_s skewness for
p3
, and Pearson's kurtosis for p4
.
BMTfit.mme
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
value |
the value of the corresponding objective function of the estimation method at the estimate. |
hessian |
a symmetric matrix computed by |
loglik |
the log-likelihood value. |
order |
the vector of moment(s) matched: mean (1), standard deviation (2), Pearson's skewness (3), Pearson's kurtosis (4). |
memp |
the empirical moment function. |
optim.function |
the name of the optimization function used for maximum product of spacing. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mmedist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.qme
,
BMTfit.mle
, BMTfit.mge
,
BMTfit.mpse
and BMTfit.mqde
for other estimation
methods. See optim
and constrOptim
for
optimization routines. See BMTfit
and fitdist
for functions that return an objetc of class "fitdist"
.
# (1) basic fit by moment matching estimation set.seed(1234) x1 <- rBMT(n=100, p3=0.25, p4=0.75) BMTfit.mme(x1) # (3) how to change the optimisation method? BMTfit.mme(x1, optim.method="L-BFGS-B") BMTfit.mme(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mme(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mme(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
# (1) basic fit by moment matching estimation set.seed(1234) x1 <- rBMT(n=100, p3=0.25, p4=0.75) BMTfit.mme(x1) # (3) how to change the optimisation method? BMTfit.mme(x1, optim.method="L-BFGS-B") BMTfit.mme(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mme(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mme(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
Fit of the BMT distribution to non-censored data by maximum product of spacing estimation (mpse), also called maximum spacing estimation.
BMTfit.mpse(data, 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, silent = TRUE, ...)
BMTfit.mpse(data, 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, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
silent |
A logical to remove or show warnings when bootstraping. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the maximum product of spacing
method.
BMTfit.mpse
is based on the function mpsedist
but it
focuses on the maximum product of spacing parameter estimation for the BMT
distribution (see BMT
for details about the BMT distribution
and mpsedist
for details about maximum product of spacing fit
of univariate distributions).
BMTfit.mpse
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
value |
the value of the corresponding objective function of the estimation method at the estimate. |
loglik |
the log-likelihood value. |
hessian |
a symmetric matrix computed by |
optim.function |
the name of the optimization function used for maximum product of spacing. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mpsedist
which in turn is based on
the function mledist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.mme
,
BMTfit.qme
, BMTfit.mge
, BMTfit.mle
and BMTfit.mqde
for other estimation methods. See
optim
and constrOptim
for optimization routines.
See BMTfit
and fitdist
for functions that return
an objetc of class "fitdist"
.
# (1) basic fit by maximum product of spacing estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mpse(x1) # (2) how to change the optimisation method? BMTfit.mpse(x1, optim.method="L-BFGS-B") BMTfit.mpse(x1, custom.optim="nlminb") # (3) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mpse(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (4) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mpse(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
# (1) basic fit by maximum product of spacing estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.mpse(x1) # (2) how to change the optimisation method? BMTfit.mpse(x1, optim.method="L-BFGS-B") BMTfit.mpse(x1, custom.optim="nlminb") # (3) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mpse(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (4) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mpse(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
Fit of the BMT distribution to non-censored data by minimum quantile distance (mqde), which can also be called maximum quantile goodness-of-fit.
BMTfit.mqde(data, probs = (1:length(data) - 0.5)/length(data), qtype = 5, dist = "euclidean", 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, weights = NULL, silent = TRUE, ...)
BMTfit.mqde(data, probs = (1:length(data) - 0.5)/length(data), qtype = 5, dist = "euclidean", 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, weights = NULL, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
probs |
A numeric vector of the probabilities for which the minimum
quantile distance estimation is done. |
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 BMT
distribution or a function of data computing initial values and returning a
named list. (see the 'details' section of
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
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. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the minimum quantile distance
method.
BMTfit.mqde
is based on the function mqdedist
but it
focuses on the minimum quantile distance parameter estimation for the BMT
distribution (see BMT
for details about the BMT distribution
and mqdedist
for details about minimum quantile distance fit
of univariate distributions).
Given the close-form expression of the quantile
function, two optimization methods were added when the euclidean distance is
selected: Coordinate descend ("CD"
) and Newton-Rhapson ("NR"
).
BMTfit.mqde
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
value |
the value of the corresponding objective function of the estimation method at the estimate. |
hessian |
a symmetric matrix computed by |
loglik |
the log-likelihood value. |
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 for maximum product of spacing. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mqdedist
which in turn is based on
the function mledist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.mme
,
BMTfit.mle
, BMTfit.mge
,
BMTfit.mpse
and BMTfit.qme
for other estimation
methods. See optim
and constrOptim
for
optimization routines. See BMTfit
and fitdist
for functions that return an objetc of class "fitdist"
.
# (1) basic fit by minimum quantile distance estimation set.seed(1234) x1 <- rBMT(n=100, p3=0.25, p4=0.75) BMTfit.mqde(x1) # (2) quantile matching is a particular case of minimum quantile distance BMTfit.mqde(x1, probs=c(0.2,0.4,0.6,0.8), qtype=7) # (3) maximum or manhattan instead of euclidean distance BMTfit.mqde(x1, dist="maximum") BMTfit.mqde(x1, dist="manhattan") # (4) how to change the optimisation method? BMTfit.mqde(x1, optim.method="L-BFGS-B") BMTfit.mqde(x1, custom.optim="nlminb") # (5) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mqde(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (6) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mqde(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
# (1) basic fit by minimum quantile distance estimation set.seed(1234) x1 <- rBMT(n=100, p3=0.25, p4=0.75) BMTfit.mqde(x1) # (2) quantile matching is a particular case of minimum quantile distance BMTfit.mqde(x1, probs=c(0.2,0.4,0.6,0.8), qtype=7) # (3) maximum or manhattan instead of euclidean distance BMTfit.mqde(x1, dist="maximum") BMTfit.mqde(x1, dist="manhattan") # (4) how to change the optimisation method? BMTfit.mqde(x1, optim.method="L-BFGS-B") BMTfit.mqde(x1, custom.optim="nlminb") # (5) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mqde(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1)) # (6) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.mqde(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1))
Fit of the BMT distribution to non-censored data by quantile matching estimation (qme).
BMTfit.qme(data, probs = c(0.2, 0.4, 0.6, 0.8), qtype = 7, 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, silent = TRUE, ...)
BMTfit.qme(data, probs = c(0.2, 0.4, 0.6, 0.8), qtype = 7, 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, silent = TRUE, ...)
data |
A numeric vector with the observed values for non-censored data. |
probs |
A numeric vector of the probabilities for which the quantile matching is done. The length of this vector must be equal to the number of parameters to estimate. |
qtype |
The quantile type used by the R |
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
|
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
|
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 |
|
custom.optim |
A function carrying the optimization (see the 'details'
section of |
silent |
A logical to remove or show warnings when bootstraping. |
... |
Further arguments to be passed to generic functions or to the
function |
This function is not intended to be called directly but is internally
called in BMTfit
when used with the quantile matching method.
BMTfit.qme
is based on the function qmedist
but it
focuses on the quantile matching parameter estimation for the BMT
distribution (see BMT
for details about the BMT distribution
and qmedist
for details about quantile matching fit of
univariate distributions).
BMTfit.qme
returns a list with following components,
estimate |
the parameter estimates. |
convergence |
an integer code for the convergence of
|
value |
the value of the corresponding objective function of the estimation method at the estimate. |
hessian |
a symmetric matrix computed by |
loglik |
the log-likelihood value. |
probs |
the probability vector on which quantiles are matched. |
optim.function |
the name of the optimization function used for maximum product of spacing. |
optim.method |
when |
fix.arg |
the named list giving the values of parameters of the named
distribution that must kept fixed rather than estimated or |
fix.arg.fun |
the function used to set the value of |
weights |
the vector of weigths used in the estimation process or
|
counts |
A two-element integer vector giving the number of calls to the
log-likelihood function and its gradient respectively. This excludes those
calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function qmedist
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.
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 BMT
for the BMT density, distribution, quantile
function and random deviates. See BMTfit.mme
,
BMTfit.mle
, BMTfit.mge
,
BMTfit.mpse
and BMTfit.mqde
for other estimation
methods. See optim
and constrOptim
for
optimization routines. See BMTfit
and fitdist
for functions that return an objetc of class "fitdist"
.
# (1) basic fit by quantile matching estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.qme(x1) # (2) changing the probability vector on which quantiles are matched BMTfit.qme(x1, probs=c(0.1,0.3,0.5,0.75)) # (3) how to change the optimisation method? BMTfit.qme(x1, optim.method="L-BFGS-B") BMTfit.qme(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.qme(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1), probs=c(1/3,2/3)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.qme(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1), probs=c(1/3,2/3))
# (1) basic fit by quantile matching estimation set.seed(1234) x1 <- rBMT(n=100, p3 = 0.25, p4 = 0.75) BMTfit.qme(x1) # (2) changing the probability vector on which quantiles are matched BMTfit.qme(x1, probs=c(0.1,0.3,0.5,0.75)) # (3) how to change the optimisation method? BMTfit.qme(x1, optim.method="L-BFGS-B") BMTfit.qme(x1, custom.optim="nlminb") # (4) estimation of the tails weights parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.qme(x1, start=list(p3=0.5, p4=0.5), fix.arg=list(p1=0, p2=1), probs=c(1/3,2/3)) # (5) estimation of the asymmetry-steepness parameters of the BMT # distribution with domain fixed at [0,1] BMTfit.qme(x1, start=list(p3=0, p4=0.5), type.p.3.4 = "a-s", fix.arg=list(p1=0, p2=1), probs=c(1/3,2/3))
Kurtosis and steepness coefficient for the BMT distribution with
p3
and p4
tails weights ( and
)
or asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or location-scale (mean and
standard deviation) parameters.
BMTkurt(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTsteep(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
BMTkurt(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTsteep(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
See References.
BMTkurt
gives the Pearson's kurtosis and BMTsteep
the
proposed steepness coefficient for the BMT distribution.
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
and type.p.1.2
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: 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.
BMTcentral
, BMTdispersion
,
BMTskewness
, BMTmoments
for other descriptive
measures or moments.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTkurt(0.25, 0.75, "t w") BMTsteep(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTkurt(0.5, 0.5, "a-s") BMTsteep(0.5, 0.5, "a-s") # domain or location-scale parameters do not affect # the skewness and the asymmetry coefficient # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTkurt(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTsteep(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTkurt(0.5, 0.5, "a-s", 0, 1, "l-s") BMTsteep(0.5, 0.5, "a-s", 0, 1, "l-s")
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTkurt(0.25, 0.75, "t w") BMTsteep(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTkurt(0.5, 0.5, "a-s") BMTsteep(0.5, 0.5, "a-s") # domain or location-scale parameters do not affect # the skewness and the asymmetry coefficient # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTkurt(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTsteep(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTkurt(0.5, 0.5, "a-s", 0, 1, "l-s") BMTsteep(0.5, 0.5, "a-s", 0, 1, "l-s")
Any raw, central or standarised moment, the moment-generating
function and the characteristic function for the BMT distribution, with
p3
and p4
tails weights ( and
)
or asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or location-scale (mean and
standard deviation) parameters.
BMTmoment(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", order, type = "standardised", method = "quadrature") BMTmgf(s, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTchf(s, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") mBMT(order, p3, p4, type.p.3.4, p1, p2, type.p.1.2)
BMTmoment(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d", order, type = "standardised", method = "quadrature") BMTmgf(s, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTchf(s, p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") mBMT(order, p3, p4, type.p.3.4, p1, p2, type.p.1.2)
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
order |
order of the moment. |
type |
type of the moment: raw, central or standardised (default). |
method |
method to obtain the moment: exact formula or Chebyshev-Gauss quadrature (default). |
s |
variable for the moment-generating and characteristic functions. |
See References.
BMTmoment
gives any raw, central or standarised moment,
BMTmgf
the moment-generating function and BMTchf
the
characteristic function
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
, type.p.1.2
, type
and
method
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: 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.
BMTcentral
, BMTdispersion
,
BMTskewness
, BMTkurtosis
for specific
descriptive measures or moments.
layout(matrix(1:4, 2, 2, TRUE)) s <- seq(-1, 1, length.out = 100) # BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmoment(0.25, 0.75, order = 5) # hyperskewness by Gauss-Legendre quadrature BMTmoment(0.25, 0.75, order = 5, method = "exact") # hyperskewness by exact formula mgf <- BMTmgf(s, 0.25, 0.75) # moment-generation function plot(s, mgf, type="l") chf <- BMTchf(s, 0.25, 0.75) # characteristic function # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 BMTmoment(0.5, 0.5, "a-s", order = 5) BMTmoment(0.5, 0.5, "a-s", order = 5, method = "exact") mgf <- BMTmgf(s, 0.5, 0.5, "a-s") plot(s, mgf, type="l") chf <- BMTchf(s, 0.5, 0.5, "a-s") # BMT on [-1.783489, 3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmoment(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d", order = 5) BMTmoment(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d", order = 5, method = "exact") mgf <- BMTmgf(s, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") plot(s, mgf, type="l") chf <- BMTchf(s, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 BMTmoment(0.5, 0.5, "a-s", 0, 1, "l-s", order = 5) BMTmoment(0.5, 0.5, "a-s", 0, 1, "l-s", order = 5, method = "exact") mgf <- BMTmgf(s, 0.5, 0.5, "a-s", 0, 1, "l-s") plot(s, mgf, type="l") chf <- BMTchf(s, 0.5, 0.5, "a-s", 0, 1, "l-s")
layout(matrix(1:4, 2, 2, TRUE)) s <- seq(-1, 1, length.out = 100) # BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmoment(0.25, 0.75, order = 5) # hyperskewness by Gauss-Legendre quadrature BMTmoment(0.25, 0.75, order = 5, method = "exact") # hyperskewness by exact formula mgf <- BMTmgf(s, 0.25, 0.75) # moment-generation function plot(s, mgf, type="l") chf <- BMTchf(s, 0.25, 0.75) # characteristic function # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 BMTmoment(0.5, 0.5, "a-s", order = 5) BMTmoment(0.5, 0.5, "a-s", order = 5, method = "exact") mgf <- BMTmgf(s, 0.5, 0.5, "a-s") plot(s, mgf, type="l") chf <- BMTchf(s, 0.5, 0.5, "a-s") # BMT on [-1.783489, 3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTmoment(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d", order = 5) BMTmoment(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d", order = 5, method = "exact") mgf <- BMTmgf(s, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") plot(s, mgf, type="l") chf <- BMTchf(s, 0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.5 BMTmoment(0.5, 0.5, "a-s", 0, 1, "l-s", order = 5) BMTmoment(0.5, 0.5, "a-s", 0, 1, "l-s", order = 5, method = "exact") mgf <- BMTmgf(s, 0.5, 0.5, "a-s", 0, 1, "l-s") plot(s, mgf, type="l") chf <- BMTchf(s, 0.5, 0.5, "a-s", 0, 1, "l-s")
Skewness and an asymmetry coefficient for the BMT distribution,
with p3
and p4
tails weights ( and
) or asymmetry-steepness parameters (
and
) and
p1
and p2
domain (minimum and maximum) or
location-scale (mean and standard deviation) parameters.
BMTskew(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTasymm(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
BMTskew(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d") BMTasymm(p3, p4, type.p.3.4 = "t w", p1 = 0, p2 = 1, type.p.1.2 = "c-d")
p3 , p4
|
tails weights ( |
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. |
p1 , p2
|
domain (minimum and maximum) or location-scale (mean and standard deviation) parameters of the BMT ditribution. |
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. |
See References.
BMTskew
gives the Pearson's skewness and BMTasymm
the
proposed asymmetry coefficient for the BMT distribution.
The arguments are recycled to the length of the result. Only the first
elements of type.p.3.4
and type.p.1.2
are used.
If type.p.3.4 == "t w"
, p3 < 0
and p3 > 1
are errors
and return NaN
.
If type.p.3.4 == "a-s"
, p3 < -1
and p3 > 1
are errors
and return NaN
.
p4 < 0
and p4 > 1
are errors and return NaN
.
If type.p.1.2 == "c-d"
, p1 >= p2
is an error and returns
NaN
.
If type.p.1.2 == "l-s"
, p2 <= 0
is an error and returns
NaN
.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Torres-Jimenez, C. J. and Montenegro-Diaz, A. M. (2017, September), An alternative to continuous univariate distributions supported on a bounded interval: 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.
BMTcentral
, BMTdispersion
,
BMTkurtosis
, BMTmoments
for other descriptive
measures or moments.
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTskew(0.25, 0.75, "t w") BMTasymm(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTskew(0.5, 0.5, "a-s") BMTasymm(0.5, 0.5, "a-s") # domain or location-scale parameters do not affect # the skewness and the asymmetry coefficient # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTskew(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTasymm(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTskew(0.5, 0.5, "a-s", 0, 1, "l-s") BMTasymm(0.5, 0.5, "a-s", 0, 1, "l-s")
# BMT on [0,1] with left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTskew(0.25, 0.75, "t w") BMTasymm(0.25, 0.75, "t w") # BMT on [0,1] with asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTskew(0.5, 0.5, "a-s") BMTasymm(0.5, 0.5, "a-s") # domain or location-scale parameters do not affect # the skewness and the asymmetry coefficient # BMT on [-1.783489,3.312195] with # left tail weight equal to 0.25 and # right tail weight equal to 0.75 BMTskew(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") BMTasymm(0.25, 0.75, "t w", -1.783489, 3.312195, "c-d") # BMT with mean equal to 0, standard deviation equal to 1, # asymmetry coefficient equal to 0.5 and # steepness coefficient equal to 0.75 BMTskew(0.5, 0.5, "a-s", 0, 1, "l-s") BMTasymm(0.5, 0.5, "a-s", 0, 1, "l-s")
Fit of univariate distributions for non-censored data using maximum product of spacing estimation (mpse), also called maximum spacing estimation.
mpsedist(data, distr, start = NULL, fix.arg = NULL, optim.method = "default", lower = -Inf, upper = Inf, custom.optim = NULL, weights = NULL, silent = TRUE, gradient = NULL, ...)
mpsedist(data, distr, start = NULL, fix.arg = NULL, optim.method = "default", lower = -Inf, upper = Inf, custom.optim = NULL, weights = NULL, silent = TRUE, gradient = NULL, ...)
data |
A numeric vector with the observed values for non-censored data. |
distr |
A character string |
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 mpsedist
function carries out the maximum product of
spacing estimation numerically, by maximization of the arithmetic mean of
.
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 mpse is carried out,
otherwise the specified weights are used to compute a weighted arithmetic
mean.
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.mpse
.
mpsedist
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. |
loglik |
the log-likelihood. |
hessian |
a symmetric matrix computed by |
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 |
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 two-element integer vector giving the number of calls to
the log-likelihood function and its gradient respectively. This excludes
those calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mledist 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.
Functions checkparam
and start.arg.default
are needed and
were copied from the same package (fitdistrplus version: 1.0-9).
Cheng, R. and N. Amin (1983). Estimating parameters in continuous univariate distributions with a shifted origin. Journal of the Royal Statistical Society. Series B (Methodological), 394-403.
Ranneby, B. (1984). The maximum spacing method. an estimation method related to the maximum likelihood method. Scandinavian Journal of Statistics, 93-112.
mqdedist
, mledist
,
mmedist
, qmedist
,
mgedist
, and optim
.
# (1) basic fit of a normal distribution set.seed(1234) x1 <- rnorm(n = 100) mean(x1); sd(x1) mpse1 <- mpsedist(x1, "norm") mpse1$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((a-x)/b)*exp(-exp((a-x)/b)) pgumbel <- function(q, a, b) exp(-exp((a-q)/b)) qgumbel <- function(p, a, b) a-b*log(-log(p)) mpse1 <- mpsedist(x1, "gumbel", start = list(a = 10, b = 5)) mpse1$estimate # (3) fit a discrete distribution (Poisson) set.seed(1234) x2 <- rpois(n = 30, lambda = 2) mpse2 <- mpsedist(x2, "pois") mpse2$estimate # (4) fit a finite-support distribution (beta) set.seed(1234) x3 <- rbeta(n = 100, shape1 = 5, shape2 = 10) mpse3 <- mpsedist(x3, "beta") mpse3$estimate # (5) fit frequency distributions on USArrests dataset. x4 <- USArrests$Assault mpse4pois <- mpsedist(x4, "pois") mpse4pois$estimate mpse4nbinom <- mpsedist(x4, "nbinom") mpse4nbinom$estimate # (6) weighted fit of a normal distribution set.seed(1234) w1 <- runif(101) mpse1 <- mpsedist(x1, "norm", weights = w1) mpse1$estimate
# (1) basic fit of a normal distribution set.seed(1234) x1 <- rnorm(n = 100) mean(x1); sd(x1) mpse1 <- mpsedist(x1, "norm") mpse1$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((a-x)/b)*exp(-exp((a-x)/b)) pgumbel <- function(q, a, b) exp(-exp((a-q)/b)) qgumbel <- function(p, a, b) a-b*log(-log(p)) mpse1 <- mpsedist(x1, "gumbel", start = list(a = 10, b = 5)) mpse1$estimate # (3) fit a discrete distribution (Poisson) set.seed(1234) x2 <- rpois(n = 30, lambda = 2) mpse2 <- mpsedist(x2, "pois") mpse2$estimate # (4) fit a finite-support distribution (beta) set.seed(1234) x3 <- rbeta(n = 100, shape1 = 5, shape2 = 10) mpse3 <- mpsedist(x3, "beta") mpse3$estimate # (5) fit frequency distributions on USArrests dataset. x4 <- USArrests$Assault mpse4pois <- mpsedist(x4, "pois") mpse4pois$estimate mpse4nbinom <- mpsedist(x4, "nbinom") mpse4nbinom$estimate # (6) weighted fit of a normal distribution set.seed(1234) w1 <- runif(101) mpse1 <- mpsedist(x1, "norm", weights = w1) mpse1$estimate
Fit of univariate distributions for non-censored data using minimum quantile distance estimation (mqde), which can also be called maximum quantile goodness-of-fit estimation.
mqdedist(data, distr, probs = (1:length(data) - 0.5)/length(data), qtype = 5, dist = "euclidean", start = NULL, fix.arg = NULL, optim.method = "default", lower = -Inf, upper = Inf, custom.optim = NULL, weights = NULL, silent = TRUE, gradient = NULL, ...)
mqdedist(data, distr, probs = (1:length(data) - 0.5)/length(data), qtype = 5, dist = "euclidean", start = NULL, fix.arg = NULL, optim.method = "default", lower = -Inf, upper = Inf, custom.optim = NULL, weights = NULL, silent = TRUE, gradient = NULL, ...)
data |
A numeric vector with the observed values for non-censored data. |
distr |
A character string |
probs |
A numeric vector of the probabilities for which the minimum
quantile distance estimation is done. |
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 log-likelihood. |
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 two-element integer vector giving the number of calls to
the log-likelihood function and its gradient respectively. This excludes
those calls needed to compute the Hessian, if requested, and any calls to
log-likelihood function to compute a finite-difference approximation to the
gradient. |
optim.message |
A character string giving any additional information
returned by the optimizer, or |
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
Based on the function mledist 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.
Functions checkparam
and start.arg.default
are needed and
were copied from the same package (fitdistrplus version: 1.0-9).
LaRiccia, V. N. (1982). Asymptotic Properties of Weighted $L^2$ Quantile Distance Estimators. The Annals of Statistics, 10(2), 621-624.
Torres-Jimenez, C. J. (2017, September), Comparison of estimation methods for the BMT distribution. ArXiv e-prints.
mpsedist
, mledist
,
mmedist
, qmedist
,
mgedist
, optim
,
constrOptim
, and quantile
.
# (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((a-x)/b)*exp(-exp((a-x)/b)) pgumbel <- function(q, a, b) exp(-exp((a-q)/b)) qgumbel <- function(p, a, b) a-b*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 finite-support 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
# (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((a-x)/b)*exp(-exp((a-x)/b)) pgumbel <- function(q, a, b) exp(-exp((a-q)/b)) qgumbel <- function(p, a, b) a-b*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 finite-support 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
Classic performance score in mathematics, using the students responses to Booklet 10 of the PISA test applied in 2012. We use the answers to the PISA 2012 questionnaire. We take the “Scored cognitive item response data file.”. We keep all the questions with binary score (correct and incorrect) and exclude those that could be scored with partial credit. Then, we recode the responses: 1 for correct and 0 for incorrect. Finally, we obtain the percentage of correct answers, i.e., the classic performance score of each student. It is important to mention that the reported scores of PISA 2012 are estimated and scaled using the Rasch model of item response theory. On the other hand, all booklets for the test could have different: number of questions, traits evaluated, and participating countries. Also, the assignation of a booklet to a student is randomized. Considering that, we choose only one arbitrary booklet, Booklet 10, and its questions of mathematics.
data(score.math.booklet10.PISA2012)
data(score.math.booklet10.PISA2012)
score.math.booklet10.PISA2012
is a vector.
Camilo Jose Torres-Jimenez [aut,cre] [email protected]
OECD Programme for International Student Assesment (PISA) (2012). Database - PISA 2012. Online; accessed 2014-08-23. https://www.oecd.org/pisa/pisaproducts/pisa2012database-downloadabledata.htm.