rnorm.mix: Sample from a Normal distribution with outliers

Description Usage Arguments Value Examples

Description

Simulates a samples of normally distributed data, each "contaminated" with outliers from a different normal distribution according to a user-specified probability. Similar to rnorm.out, except that the order of arguments is different and the output is formatted as a vector.

Usage

1
2
rnorm.mix(n, mean = 0, sd = 1, contam.p = 0.01, contam.mean = -5,
  contam.sd = 0)

Arguments

n

The number of independent observations per sample

mean

The expectation of the target distribution.

sd

The standard deviation of the target distribution.

contam.p

The probability that each observation is from the non-target distribution.

contam.mean

The expectation of the non-target / "contamination" / outlier distribution.

contam.sd

The standard deviation of the outlier distribution.

Value

A vector of independent random numbers n entries.

Examples

1
rnorm.mix(20, 0, 1, .2, 10, 1)

mdedge/stfspack documentation built on May 9, 2019, 8:17 a.m.