Description Usage Arguments Details Value References See Also Examples
Taking a random sample of size n from the density f^* with seven cusps introduced in the article of Savchuk (2017).
1 | sample_fstar(n)
|
n |
sample size. |
The density f^* can be used in simulation studies.
The numerical vector of size n of the data values.
Savchuk, O.Y. (2017). One-sided cross-validation for nonsmooth density functions, arXiv:1703.05157.
1 2 3 4 5 6 7 8 9 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.