b.CV: Least Squares Cross-Validation for Local Linear Hazards

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Bandwidth selection for local linear hazard estimation using least squares cross-validation

Usage

1
b.CV(grid.b, nb , K = "epa", xi, Oi, Ei, wei = "exposure")

Arguments

grid.b

Optional. A vector of bandwidths to minimise the cross-validation score. If not specified it will be considered an equally-spaced grid of nb bandwidths between "amp/(M+1)" and "amp/2" for "amp" being the range of xi and "M" its length.

nb

Optional. The number of bandwidths used to minimise the cross-validation score. If grid.b is provided then the argument nb will be ignored (if specified).

K

Indicates the kernel function to be considered in the local linear hazard estimator. Choose between values "epa" (for the epanechnikov kernel) or "sextic" (see details of hazard.LL for the definition).

xi

Vector of time points where the count data are given.

Oi

Vector with the number (counts) of occurrences observed at each time point (xi).

Ei

Vector with the observed exposure at each time point (xi).

wei

Indicates the weights used in the cross-validation score. Choose between the value "exposure" or "same". See details below.

Details

It is assumed that the data are given as count data i.e. number of occurrences and exposures.

If the cross-validation score is strictly increasing or decreasing then a warning will be shown together with the cross-validated bandwidth (in this case one of the extremes in grid.b).

The cross-validation score is defined with two different weighting functions. This is controlled with the parameter wei. By default wei="exposure" that means that only areas where the exposure is significant contribute to the criterion. Specify wei="same" to allow all time points contribute the same to the criterion (see Gamiz et al. 2017).

Value

bcv

The cross-validated bandwidth.

ind.cv

The position of the cross-validated bandwidth into grid.b.

cv.values

The values of the cross-validation score for each bandwidth in grid.b.

b.grid

The grid of bandwidths where the cross-validation score has been evaluated.

Author(s)

Gamiz, M.L., Mammen, E., Martinez-Miranda, M.D. and Nielsen, J.P.

References

Gamiz, M.L., Mammen, E., Martinez-Miranda, M.D. and Nielsen, J.P.(2016). Double one-sided cross-validation of local linear hazards. Journal of the Royal Statistical Society B, 78, 755-779.

Gamiz, M.L., Martinez-Miranda, M.D. and Nielsen, J.P. (2017). Multiplicative local linear hazard estimation and best one-sided cross-validation. Available at http://arxiv.org/abs/1710.05575

Nielsen, J.P. and Tanggaard, C. (2001). Boundary and bias correction in kernel hazard estimation. Scandinavian Journal of Statistics, 28, 675-698.

See Also

hazard.LL,b.OSCV,b.BO

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(UK)
Oi<-UK$D
Ei<-UK$E 
ti<-40:110  # time is age and it goes from 40 to 110 years
M<-length(ti)
my.bs<-seq(1,5,length=50)
res.cv<-b.CV(grid.b=my.bs,K="sextic",xi=ti,Oi=Oi,Ei=Ei)
bcv<-res.cv$bcv
cv.values<-res.cv$cv.values
plot(my.bs,cv.values,main="Cross-validation score",xlab="Bandwidth")
print(paste("The cross-validated bandwidth is:", bcv,sep=" "))

Example output

[1] "The cross-validated bandwidth is: 1.97959183673469"

DOvalidation documentation built on May 2, 2019, 10:16 a.m.