Description Usage Arguments Details Value References See Also Examples
Computing the values of the L_G-based OSCV function in the density estimation context. See Savchuk (2017).
1 | OSCV_Gauss_dens(h, dat, stype)
|
h |
numerical vector of bandwidth values, |
dat |
numerical vecror of data values, |
stype |
specifies (anticipated) smoothness of the density function. Thus, stype=0 corresponds to the smooth density, whereas stype=1 corresponds to the nonsmooth density. |
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 Gaussian kernel L_G. The (anticipated) smoothness of the underlying density function is to be specified. Thus,
stype=0 corresponds to the smooth density;
stype=1 corresponds to the nonsmooth density.
It is usually assumed that the density is smooth if no preliminary information about its nonsmoothness is available. The function's minimizer h_OSCV_dens
is to be used without additional rescaling to compute the ultimate Gaussian density estimate.
The vector of values of the OSCV function for the correponsing vector of h values.
Savchuk, O.Y. (2017). One-sided cross-validation for nonsmooth densty functions, arXiv:1703.05157.
h_OSCV_dens
, OSCV_Epan_dens
, OSCV_LI_dens
, C_smooth
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
dat_norm=rnorm(300) #generating random sample of size n=300 from the standard normal density.
h_oscv=round(h_OSCV_dens(dat_norm,0),digits=4)
y=density(dat_norm,bw=h_oscv)
dev.new()
plot(y,lwd=3,cex.lab=1.7,cex.axis=1.7,cex.main=1.7,xlab=paste("n=100, h_OSCV=",h_oscv),
main="Standard normal density estimate by OSCV",ylim=c(0,0.45),xlim=c(-4.5,4.5))
u=seq(-5,5,len=1000)
lines(u,dnorm(u),lwd=3,lty="dashed",col="blue")
legend(0.75,0.4,legend=c("OSCV estimate","N(0,1) density"),lwd=c(3,3),lty=c("solid","dashed"),
col=c("black","blue"),bty="n",cex=1.25)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.