b.CV.MBC {DOvalidation}R Documentation

Least Squares Cross-Validation for Multiplicative Bias Corrected Hazard Estimators

Description

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

Usage

b.CV.MBC(grid.b, nb , K = "sextic", xi, Oi, Ei, wei = "same")

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.MBC 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., Martinez-Miranda, M.D. and Nielsen, J.P.

References

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.MBC,b.BO.MBC,b.CV

Examples

data(Iceland)
Oi<-Iceland$D
Ei<-Iceland$E
ti<-40:110  # time is age and it goes from 40 to 110 years
my.bs<-seq(50,80,length.out=30)
res.cv<-b.CV.MBC(grid.b=my.bs,K="sextic",xi=ti,Oi=Oi,Ei=Ei,wei="same")
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=" "))



[Package DOvalidation version 1.1.0 Index]