cvbw {Conake} | R Documentation |
The function allows to calculate the optimal bandwidth using the cross-validation method. Four kernels are available: extended beta, gamma, lognormal and reciprocal inverse Gaussian kernels.
cvbw(Vec, bw = NULL, ker,a=0,b=1)
Vec |
The sample data. |
bw |
The sequence of bandwidths where the cross-validation is computed. If NULL, the procedure defines a sequence of bandwidths. |
ker |
The associated kernel: "BE" extended beta, "GA" gamma, "LN" lognormal and "RIG" reciprocal inverse Gaussian. |
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. |
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 large, the resulting estimator will be very smoothed and farther from the function that we are trying to estimate. See Libengué (2013).
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. |
bw |
The sequence of bandwidths used. |
W. E. Wansouwé, F.G. Libengué and C. C. Kokonendji
Libengué, F.G. (2013). Méthode Non-Paramétrique par Noyaux Associés Mixtes et Applications, Ph.D. Thesis Manuscript (in French) to Université de Franche-Comté, Besançon, France and Université de Ouagadougou, Burkina Faso, June 2013, LMB no. 14334, Besançon.
## Data can be simulated data or real data
## We use simulate data
## and then compute the cross validation.
Vec<-rgamma(100,1.5,2.6)
## Not run:
CV<-cvbw(Vec,ker="GA")
CV$hcv
## End(Not run)