Learn R Programming

Conake (version 1.0.1)

cvbw: Cross-validation function for bandwidth selection

Description

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.

Usage

cvbw(Vec, bw = NULL, ker,a=0,b=1)

Arguments

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.

Value

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.

Details

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<U+00E9> (2013).

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.

Examples

Run this code
# NOT RUN {
## 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
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab