sample_fstar {OSCV} | R Documentation |
Taking a random sample from fstar
.
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. |
Details
The density f^*
can be used in simulation studies.
Value
The numerical vector of size n
of the data values.
References
Savchuk, O.Y. (2017). One-sided cross-validation for nonsmooth density functions, arXiv:1703.05157.
See Also
Examples
## 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"))
## End(Not run)
[Package OSCV version 1.0 Index]