mix_norm: Mixture Normal Distribution

Description Usage Arguments Examples

View source: R/mix_norm.R

Description

Generate n observations from a mixture of two normal distributions: generate U from a Bernoulli(p) distribution and if U=1, then draw Y from a normal distribution with mean mu1 and standard deviation sigma1, or if U=0, draw Y from the other normal distribution with mean mu2 and standard deviation sigma2

Usage

1
mix_norm(p, mu1, mu2, sigma1, sigma2)

Arguments

p

numeric, probability that Y is drawn from a normal distribution N(mu1,sigma1)

mu1

numeric, mean of first normal distribution

mu2

numeric, mean of second normal distribution

sigma1

numeric, standard deviation of first normal distribution

sigma2

numeric, standard deviation of second normal distribution

Examples

1
mix_norm(0.5,-2,3,2,1.5)

RashaAlsaadawi/FinalRasha documentation built on Dec. 31, 2020, 4:23 p.m.