The function estimates the density in a single value or in a
grid using discrete associated kernels. Four different associated kernels are available: extended beta, gamma, lognormal and reciprocal inverse Gaussian.
Usage
dke(vec_data, ker, bw, x = NULL,a=0,b=1)
Arguments
vec_data
The data sample.
ker
The associated kernel: "BE" extended beta, "GA" gamma, "LN" lognormal and "RIG" reciprocal inverse Gaussian.
bw
The bandwidth or smoothing parameter.
x
The single value or grid where estimation is computed
a
The left bound of the support used for extended beta kernel. Default value is 0 for beta kernel.
b
The right bound of the support used for extended beta kernel. Default value is 1 for beta kernel.
Value
Returns a list containing:
C_n
The normalizing constant.
f_n
The values of the estimated function
Details
The kernel estimator \(\widehat{f}_n\) of \(f\) is defined in the above sections.
We recall that in general, the sum of the estimated values on the support is not equal to 1. In practice, we calculate the normalizing constant \(C_n\) before computing the estimated density \(\tilde{f}_n\); see Libengu<U+00E9> (2013) .
The bandwidth parameter in the function is obtained using the cross-validation technique for the four kernels.
References
Libengu<U+00E9>, F.G. (2013). M<U+00E9>thode Non-Param<U+00E9>trique par Noyaux Associ<U+00E9>s Mixtes et Applications, Ph.D. Thesis Manuscript (in French) to Universit<U+00E9> de Franche-Comt<U+00E9>, Besan<U+00E7>on, France and Universit<U+00E9> de Ouagadougou, Burkina Faso, June 2013, LMB no. 14334, Besan<U+00E7>on.
# NOT RUN {## A sample data with n=100.V<-rgamma(100,1.5,2.6)
##The bandwidth can be the one obtained by cross validation.h<-0.052## We choose Gamma kernel.est<-dke(V,"GA",h)
est$f_n
# }