random contaminated normal deviates

Share:

Description

Generate a random sample from a contaminated normal distribution.

Usage

1
rcn(n, eps, sigmac)

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

Value

n x 1 numeric vector containing the random deviates.

Author(s)

John Kloke kloke@biostat.wisc.edu, Joseph McKean

References

Hogg, R. McKean, J, Craig, A (2013) Introduction to Mathematical Statistics, 7th Ed. Boston: Pearson.

See Also

rnorm

Examples

1
qqnorm(rcn(100,.25,10))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.