Description Usage Arguments Details Value Author(s) References Examples
The function allows to calculate the optimal bandwidth using the cross-validation method. Three kernels are available: DiracDU, Binomial and Discrete Triangular. For Binomial kernel, the bandwidth is always less than 1; see Kokonendji and Senga Kiessé (2011), and also Kokonendji et al. (2007).
1 |
Vec |
The sample data. |
seq_bws |
The sequence of bandwidths where the cross-validation is computed. If NULL, the procedure defines a sequence of bandwidths. |
ker |
The associated kernel: "dirDU" DiracDU, "bino" Binomial, "triang" Discrete Triangular. |
a |
The arm in Discrete Triangular kernel. The default value is 1. |
c |
The number of categories in DiracDU kernel. The default value is 2. |
The selection of the bandwidth parameter is crucial. If the bandwidth is small, we will obtain an undersmoothed estimator, with high variability. On the contrary, if the value is big, the resulting estimator will be very smooth and farther from the function that we are trying to estimate. The cross-validation function defined in the above sections is used to compute the optimal bandwidth for the three kernels.
Returns a list containing:
hcv |
The optimal bandwidth obtained by cross-validation. |
CV |
The values of the cross-validation function in the sequence of bandwidths. |
seq_bws |
The sequence of bandwidths used. |
W. E. Wansouwé, C. C. Kokonendji and D. T. Kolyang
Kokonendji, C.C. and Senga Kiessé, T. (2011). Discrete associated kernel method and extensions, Statistical Methodology 8, 497 - 516.
Kokonendji, C.C., Senga Kiessé, T. and Zocchi, S.S. (2007). Discrete triangular distributions and non-parametric estimation for probability mass function, Journal of Nonparametric Statistics 19, 241 - 254.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Data can be simulated data or real data
## We use real data
## and then compute the cross validation.
Vec<-c(10,0,1,0,4,0,6,0,0,0,1,1,1,2,4,4,5,6,6,6,6,7,1,7,0,7,7,
7,8,0,8,12,8,8,9,9,0,9,9,10,10,10,10,0,10,10,11,12,12,10,12,12,
13,14,15,16,16,17,0,12)
## Not run:
CV<-CVbw(Vec,NULL,"bino")
CV$hcv
## End(Not run)
##The cross validation function can be also ploted.
## Not run:
plot(CV$seq_bws,CV$CV, type="l")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.