| OSCV_reg {OSCV} | R Documentation |
The OSCV function in the regression context.
Description
Computing OSCV(b), the value of the OSCV function in the regression context, defined by expression (9) of Savchuk and Hart (2017).
Usage
OSCV_reg(b, desx, y, ktype)
Arguments
b |
numerical vector of bandwidth values, |
desx |
numerical vecror of design points, |
y |
numerical vecror of data points corresponding to the design points |
ktype |
making choice between two cross-validation kernels: ( |
Details
Computation of OSCV(b) for given b (bandwidth vector) and the data values y corresponding to the design points desx. No preliminary sorting of the data (according to the desx variable) is needed. The value of m=4 is used. Two choices of the two-sided cross-validation kernel are available:
(
ktype=0) Gaussian kernel;(
ktype=1) robust kernelH_Idefined by expression (15) of Savchuk and Hart (2017) with(\alpha,\sigma)=(16.8954588,1.01).
Value
The vector of values of OSCV(b) for the correponsing vector of b values.
References
Savchuk, O.Y., Hart, J.D. (2017). Fully robust one-sided cross-validation for regression functions. Computational Statistics, doi:10.1007/s00180-017-0713-7.
Hart, J.D. and Yi, S. (1998) One-sided cross-validation. Journal of the American Statistical Association, 93(442), 620-631.
See Also
h_OSCV_reg, H_I, loclin, C_smooth.
Examples
## Not run:
# The Old Faithful geyser data set "faithful" is used. The sample size n=272.
# The OSCV curves based on the Gaussian kernel and the robust kernel H_I (with
# alpha=16.8954588 and sigma=1.01) are plotted. The horizontal scales of the curves
# are changed such that their global minimizers are to be used in computing the
# Gaussian local linear estimates of the regression function.
xdat=faithful[[2]] #waiting time
ydat=faithful[[1]] #eruption duration
barray=seq(0.5,10,len=250)
C_gauss=C_smooth(1,1)
OSCV_gauss=OSCV_reg(barray/C_gauss,xdat,ydat,0)
h_gauss=round(h_OSCV_reg(xdat,ydat,0),digits=4)
dev.new()
plot(barray,OSCV_gauss,'l',lwd=3,cex.lab=1.7,cex.axis=1.7,xlab="h",ylab="OSCV criterion")
title(main="OSCV based on the Gaussian kernel",cex.main=1.7)
legend(2.5,0.25,legend=paste("h_min=",h_gauss),cex=2,bty="n")
C_H_I=C_smooth(16.8954588,1.01)
OSCV_H_I=OSCV_reg(barray/C_H_I,xdat,ydat,1)
h_H_I=round(barray[which.min(OSCV_H_I)],digits=4)
dev.new()
plot(barray,OSCV_H_I,'l',lwd=3,cex.lab=1.7,cex.axis=1.7,xlab="h",ylab="OSCV criterion",
ylim=c(0.15,0.5))
title(main="OSCV based on the robust kernel H_I",cex.main=1.7)
legend(2.5,0.4,legend=paste("h_min=",h_H_I),cex=2,bty="n")
## End(Not run)