SimNormalMix: Simulate Normal Mixture in 1d

Description Usage Arguments Value Examples

View source: R/SimNormalMix.R

Description

Simulate data from m normal distributions centered at different locations with different variances.

Usage

1
SimNormalMix(N, mu, sigma, p, seed = NULL)

Arguments

N

number of data points to simulate.

mu

vector of means.

sigma

vector of standard deviations.

p

vector of weights for each distribution.

seed

seed for RNG (default = NULL).

Value

list(x = x, label = label)

Examples

1
2
3
4
5
N = 100
mu = c(1,2,3)
sigma = c(0.1, 0.1, 0.1)
p = c(1/4, 1/4, 1/2)
SimNormalMix(N, mu, sigma, p)

feji3769/simplesim documentation built on Dec. 12, 2020, 10:16 a.m.