rcn {npsm} | R Documentation |
random contaminated normal deviates
Description
Generate a random sample from a contaminated normal distribution.
Usage
rcn(n, eps, sigmac)
rcn_5_5(n)
Arguments
n |
sample size |
eps |
proportion of proportion of contamination |
sigmac |
standard devation of contaiminated component |
Details
With probability (1-eps) a deviates are drawn from a standard normal distribution. With probability eps deviates are drawn from a normal distribution with mean 0 and standard devation sigmac rcn_5_5 is a special case where eps=0.05 and sigma=5.
Value
n x 1 numeric vector containing the random deviates.
Author(s)
John Kloke, Joseph McKean
References
Hogg, R. McKean, J, Craig, A (2013) Introduction to Mathematical Statistics, 7th Ed. Boston: Pearson.
See Also
Examples
qqnorm(rcn(100,.25,10))
set.seed(101); rcn(10,0.05,5)
set.seed(101); rcn_5_5(10)
[Package npsm version 2.0.0 Index]