Learn R Programming

OSCV (version 1.0)

sample_fstar: Taking a random sample from

Description

Taking a random sample of size \(n\) from the density \(f^*\) with seven cusps introduced in the article of Savchuk (2017).

Usage

sample_fstar(n)

Arguments

n
sample size.

Value

The numerical vector of size \(n\) of the data values.

Details

The density \(f^*\) can be used in simulation studies.

References

Savchuk, O.Y. (2017). One-sided cross-validation for nonsmooth density functions, arXiv:1703.05157.

See Also

fstar, ISE_fstar.

Examples

Run this code
## Not run: ------------------------------------
# dev.new()
# plot(density(sample_fstar(5000),bw=0.1),lwd=2,ylim=c(0,0.32),xlab="argument",ylab="density",
# main="KDE and the true density fstar",cex.lab=1.7, cex.axis=1.7,cex.main=1.7)
# lines(seq(-3.5,3.5,len=1000),fstar(seq(-3.5,3.5,len=1000)),lwd=3,lty="dashed")
# legend(-3,0.3,legend=c("KDE","True density","h=0.1","n=5000"),lwd=c(2,3),
# lty=c("solid","dashed"),col=c("black","black","white","white"))
## ---------------------------------------------

Run the code above in your browser using DataLab