Class "HirukawaTSKernel"

Description

This class deals with the TS Kernel estimator as described in Hirukawa (2010). The kernel estimator is computed using the provided data samples. Using this kernel 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 hirukawaTSKernel.

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

b:

the bandwidth of the kernel estimator

modified:

if TRUE, the modified version of the kernel estimator is used

c:

a numeric value between 0 and 1. This parameter is used in the TS approximation as a smoothing parameter

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

getb

See "getb" for details

getmodified

See "getmodified" for details

getc

See "getc" for details

Author(s)

Guzman Santafe, Borja Calvo and Aritz Perez

References

Hirukawa, M. (2010). Nonparametric multiplicative bias correction for kernel-type density estimation on the unit interval. Computational Statistics & Data Analysis, 54(2), 473-495.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# create the model 
kernel.noModified <- hirukawaTSKernel(dataPoints = tuna.r, b = 0.01, 
                      modified = FALSE, c = 0.5)
kernel.Modified <- hirukawaTSKernel(dataPoints = tuna.r, b = 0.01,
                      modified = TRUE, c = 0.5)

# examples of usual functions
density(kernel.noModified,0.5)
density(kernel.Modified,0.5)

distribution(kernel.noModified,1,discreteApproximation=FALSE)
distribution(kernel.noModified,1,discreteApproximation=TRUE)
 
distribution(kernel.Modified,1,discreteApproximation=FALSE)
distribution(kernel.Modified,1,discreteApproximation=TRUE)
 
# graphical representation
hist(tuna.r,freq=FALSE,main="Chen99 Kernels Tuna Data")
lines(kernel.noModified,col="red",lwd=2)
lines(kernel.Modified,col="blue",lwd=2)

# graphical representation using ggplot2 
graph <- gplot(list("noModified"=kernel.noModified, 
          "modified"=kernel.Modified), show=TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.