Learn R Programming

symmetry (version 0.2.3)

rmixnorm: Mixture of 2 normal distributions

Description

Generates random numbers from a mixture of 2 normal distributions

Usage

rmixnorm(n, mean1 = 0, sd1 = 1, mean2 = 0, sd2 = 1, p = 0.5)

Value

Vector of random numbers from the specified mixture of normals.

Arguments

n

number of observations

mean1

mean of the first normal

sd1

standard deviation of the first normal

mean2

mean of the second normal

sd2

standard deviation of the second normal

p

probability of the first normal