h_OSCV_reg: The OSCV bandwidth in the regression context.

Description Usage Arguments Details Value References See Also Examples

View source: R/OSCV_regfunctions.R

Description

Computing the OSCV bandwidth for the Gaussian local linear regression estimator. The Gaussian kernel is used in the bandwidth selection stage. The smoothness of the regression function is to be specified by the user.

Usage

1
h_OSCV_reg(desx, y, stype)

Arguments

desx

numerical vecror of design points,

y

numerical vecror of data points corresponding to the design points desx,

stype

smoothness of the regression function: (stype=0) smooth function; (stype=1) nonsmooth function.

Details

Computing the OSCV bandwidth for the data vector (desx,y). The Gaussian kernel is used for the cross-validation purposes and in the stage of computing the resulting local linear regression estimate. No additional rescaling of the computed bandwidth is needed. The smoothness of the regression function stype, essentially, determines the value of the bandwidth rescaling constant that is chosen in the body of the function. Thus, the constant is equal to 0.6168471 in the smooth case, and 0.5730 in the nonsmooth case. See Savchuk, Hart and Sheather (2016). The OSCV bandwidth is the minimizer of the OSCV function OSCV_reg.

Value

The OSCV bandwidth (scalar).

References

See Also

OSCV_reg, loclin, C_smooth, h_OSCV_dens, h_ASE_reg.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# Example (Old Faithful geyser)
xdat=faithful[[2]]     # waiting time
ydat=faithful[[1]]     # eruption duration
u=seq(40,100,len=1000)
h_oscv=round(h_OSCV_reg(xdat,ydat,0),digits=4)
l=loclin(u,xdat,ydat,h_oscv)
dev.new()
plot(xdat,ydat,pch=20,cex=1.5,cex.axis=1.7,cex.lab=1.7,xlab="waiting time",
ylab="eruption duration")
lines(u,l,'l',lwd=3)
title(main="Data and LLE",cex.main=1.7)
legend(35,5,legend=paste("h_OSCV=",h_oscv),cex=2,bty="n")
legend(80,3,legend="n=272",cex=2,bty="n")

## End(Not run)

OSCV documentation built on May 2, 2019, 6:44 a.m.

Related to h_OSCV_reg in OSCV...