dnorm.mixt, rnorm.mixt {ks} | R Documentation |
Random generation and density values from univariate normal mixture distribution.
dnorm.mixt(x, mus=0, sigmas=1, props=1) rnorm.mixt(n=100, mus=0, sigmas=1, props=1, mixt.label=FALSE)
n |
number of random variates |
x |
vector of quantiles |
mus |
vector of means |
sigmas |
vector of standard deviations |
props |
vector of mixing proportions |
mixt.label |
flag to output numeric label indicating the mixture component. Default is FALSE. |
Univariate normal mixture random vectors and density values.
x <- rnorm.mixt(1000, mus=c(-1,1), sigmas=c(0.5, 0.5), props=c(1/2, 1/2)) dens <- dnorm.mixt(x, mus=c(-1,1), sigmas=c(0.5, 0.5), props=c(1/2, 1/2))