KakizawaB2 {bde}R Documentation

Class "KakizawaB2"

Description

This class deals with B2 approximation to kernel density estimation as described in Kakizawa (2004). This is a Berstein polynomial approximation of the density function which uses BoundedDensity objects instead of a polynomial function. By contrast to the original Kakizawa's approach where only boundary kernels are used, here, any BoundedDensity object is allowed. Using this estimator, the methods implemented in the class can be used to compute densities, values of the distribution function, quantiles, sample the distribution and obtain graphical representations.

Objects from the Class

Objects can be created by using the generator function kakizawaB2.

Slots

dataPointsCache:

a numeric vector containing points within the [lower.limit,upper.limit] interval

densityCache:

a numeric vector containing the density for each point in dataPointsCache

distributionCache:

a numeric vector used to cache the values of the distribution function. This slot is included to improve the performance of the methods when multiple calculations of the distribution function are used

dataPoints:

a numeric vector containing data samples within the [lower.limit,upper.limit] interval. These data samples are used to obtain the kernel estimator

densityEstimator:

a BoundedDensity object used to estimate the density

lower.limit:

a numeric value for the lower limit of the bounded interval for the data

upper.limit:

a numeric value for the upper limit of the bounded interval for the data

Methods

density

See "density" for details

distribution

See "distribution" for details

quantile

See "quantile" for details

rsample

See "rsample" for details

plot

See "plot" for details

getdataPointsCache

See "getdataPointsCache" for details

getdensityCache

See "getdensityCache" for details

getdistributionCache

See "getdistributionCache" for details

getdataPoints

See "getdataPoints" for details

getm

See "getm" for details

getdensityEstimator

See "getdensityEstimator" for details

Author(s)

Guzman Santafe, Borja Calvo and Aritz Perez

References

Kakizawa, Y. (2004). Bernstein polynomial probability density estimation. Journal of Nonparametric Statistics, 16(5), 709-729.

Examples

# create the model 
# we use a MicroBetaChen99Kernel is used as estimator y KakizawaB1 approximation
est <- microBetaChen99Kernel(dataPoints = tuna.r, b = 0.01, modified = FALSE)
model <- kakizawaB2(dataPoints = tuna.r, m = 25, estimator = est)


# examples of usual functions
density(model,0.5)

distribution(model,0.5,discreteApproximation=FALSE)
 
# graphical representation
hist(tuna.r,freq=FALSE,main="Tuna Data")
lines(model, col="red",lwd=2)

# graphical representation using ggplot2 
graph <- gplot(model, show=TRUE, includePoints=TRUE)

[Package bde version 1.0.1.1 Index]