dmixbeta {mable}R Documentation

Mixture Beta Distribution

Description

Density, distribution function, quantile function and pseudorandom number generation for the Bernstein polynomial model, mixture of beta distributions, with shapes (i+1, m-i+1), i = 0, \ldots, m, given mixture proportions p = (p_0, \ldots, p_m) and support interval.

Usage

dmixbeta(x, p, interval = c(0, 1))

pmixbeta(x, p, interval = c(0, 1))

qmixbeta(u, p, interval = c(0, 1))

rmixbeta(n, p, interval = c(0, 1))

Arguments

x

a vector of quantiles

p

a vector of m+1 values. The m+1 components of p must be nonnegative and sum to one for mixture beta distribution. See 'Details'.

interval

support/truncation interval [a, b].

u

a vector of probabilities

n

sample size

Details

The density of the mixture beta distribution on an interval [a, b] can be written as a Bernstein polynomial f_m(x; p) = (b-a)^{-1}\sum_{i=0}^m p_i\beta_{mi}[(x-a)/(b-a)]/(b-a), where p = (p_0, \ldots, p_m), p_i\ge 0, \sum_{i=0}^m p_i=1 and \beta_{mi}(u) = (m+1){m\choose i}u^i(1-x)^{m-i}, i = 0, 1, \ldots, m, is the beta density with shapes (i+1, m-i+1). The cumulative distribution function is F_m(x; p) = \sum_{i=0}^m p_i B_{mi}[(x-a)/(b-a)], where B_{mi}(u), i = 0, 1, \ldots, m, is the beta cumulative distribution function with shapes (i+1, m-i+1). If \pi = \sum_{i=0}^m p_i<1, then f_m/\pi is a truncated desity on [a, b] with cumulative distribution function F_m/\pi. The argument p may be any numeric vector of m+1 values when pmixbeta() and and qmixbeta() return the integral function F_m(x; p) and its inverse, respectively, and dmixbeta() returns a Bernstein polynomial f_m(x; p). If components of p are not all nonnegative or do not sum to one, warning message will be returned.

Value

A vector of f_m(x; p) or F_m(x; p) values at x. dmixbeta returns the density, pmixbeta returns the cumulative distribution function, qmixbeta returns the quantile function, and rmixbeta generates pseudo random numbers.

Author(s)

Zhong Guan <zguan@iusb.edu>

References

Bernstein, S.N. (1912), Demonstration du theoreme de Weierstrass fondee sur le calcul des probabilities, Communications of the Kharkov Mathematical Society, 13, 1–2.

Guan, Z. (2016) Efficient and robust density estimation using Bernstein type polynomials. Journal of Nonparametric Statistics, 28(2):250-271.

Guan, Z. (2017) Bernstein polynomial model for grouped continuous data. Journal of Nonparametric Statistics, 29(4):831-848.

See Also

mable

Examples


# classical Bernstein polynomial approximation
a<--4; b<-4; m<-200
x<-seq(a,b,len=512)
u<-(0:m)/m
p<-dnorm(a+(b-a)*u)
plot(x, dnorm(x), type="l")
lines(x, (b-a)*dmixbeta(x, p, c(a, b))/(m+1), lty=2, col=2)
legend(a, dnorm(0), lty=1:2, col=1:2, c(expression(f(x)==phi(x)),
               expression(B^{f}*(x))))


[Package mable version 3.1.3 Index]