OSCV_Epan_dens: The OSCV function based on L_E, the one-sided Epanechnikov...

Description Usage Arguments Details Value References See Also Examples

View source: R/OSCV_density.R

Description

Computing the values of the L_E-based OSCV function in the density estimation context. See Martinez-Miranda et al. (2009) and Savchuk (2017).

Usage

1

Arguments

h

numerical vector of bandwidth values,

dat

numerical vecror of data values.

Details

Computing the values of the OSCV function for the given bandwidth vector h and data vector dat. The function is based on the one-sided Epanechnikov kernel L_E. The function's minimizer is to be multiplied by the appropriate rescaling constant before it can be used to compute the ultimate kernel density estimate. The formula for the rescaling constant depends on smothness of the density and on the kernel used in computing the ultimate density estimate.

Value

The vector of values of the OSCV function for the correponsing vector of h values.

References

See Also

OSCV_Gauss_dens, OSCV_LI_dens.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# Example 1 (Data on n=272 eruption duration of the Old Faithful geyser).
data=faithful[,1]
har=seq(0.05,1,len=1000)
dev.new()
plot(har,OSCV_Epan_dens(har,data),lwd=3,'l',xlab="h",ylab="L_E-based OSCV",
main="L_E_based OSCV for the data on eruption duration",cex.main=1.5,cex.lab=1.7,cex.axis=1.7)
h_min=round(optimize(OSCV_Epan_dens,c(0.001,1),tol=0.001,dat=data)$minimum, digits=4)
legend(0.1,-0.1,legend=c("n=272",paste("h_min=",h_min)),cex=2)
# The above graph appears in Savchuk (2017).

# Example 2 (Data set of size n=100 is generated from the standard normal density).
dat_norm=rnorm(100)
harray=seq(0.25,4.25,len=1000)
OSCVarray=OSCV_Epan_dens(harray,dat_norm)
dev.new()
plot(harray,OSCVarray,lwd=3,'l',xlab="h",ylab="L_E-based OSCV",
main="L_E-based OSCV for data generated from N(0,1)", cex.main=1.5,cex.lab=1.7,cex.axis=1.7)
h_min_norm=round(optimize(OSCV_Epan_dens,c(0.1,4),tol=0.001,dat=dat_norm)$minimum, digits=4)
legend(0.5,OSCVarray[1],legend=c("n=100",paste("h_min=",h_min_norm)),cex=2,bty="n")

## End(Not run)

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

Related to OSCV_Epan_dens in OSCV...