sample_fstar: Taking a random sample from 'fstar'.

Description Usage Arguments Details Value References See Also Examples

View source: R/OSCV_density.R

Description

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

Usage

1

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

fstar, ISE_fstar.

Examples

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)

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

Related to sample_fstar in OSCV...