rnorMix | R Documentation |
Generate n
random numbers, distributed according to a normal
mixture.
rnorMix(n, obj)
n |
the number of random numbers desired. |
obj |
an object of class |
For a mixture of m
, i.e., m.norMix(obj)
, components,
generate the number in each component as multinomial, and then use
rnorm
for each.
Note that the these integer (multinomial) numbers are generated via sample()
,
which is by .Random.seed
, notably from
RNGkind(sample.kind = ..)
which changed with R version 3.6.0.
numeric vector of length n
.
dnorMix
for the density, and norMix
for the construction and further methods.
x <- rnorMix(5000, MW.nm10)
hist(x)# you don't see the claw
plot(density(x), ylim = c(0,0.6),
main = "Estim. and true 'MW.nm10' density")
lines(MW.nm10, col = "orange")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.