Description Usage Arguments Value Author(s) References Examples
Density, distribution, function, quantile function, and random generation for the mixture of two Gaussian distributions with mixture proportion p
and 1-p
.
1 2 3 4 |
x |
vector of quantiles or probabilities. |
n |
number of observations. |
mean |
vector of two means. |
sd |
vector of standard deviations. |
p |
mixture proportion of the first distribution (the second has proportion 1-p). |
dnormMix
gives the density, pnormMix
gives the distribution function, qnormMix
gives the quantile function, and rnormMix
generates random deviates.
Leendert van Maanen (l.vanmaanen@uva.nl)
Van Maanen, L. & Van Rijn, H (submitted). The fixed-point property in concurrent processing. Manuscript submitted for publication
1 2 3 4 5 6 7 8 9 10 11 | ## the default value for p reduces this function to a normal distribution
dnormMix(1) == dnorm(1)
## plot that illustrates the fixed-point property
p <- c(.8,.5,.2)
m <- c(0,1); s <- c(1,2)
plot(function(X) {dnormMix(X, m, s, p[1])}, -5,10, ylab="Density",xlab="x", bty='L')
for (i in 2:3) {
plot(function(X) {dnormMix(X, m, s, p[i])},-5,10, add=TRUE, lty=i, lwd=2)
}
legend("topright", legend=paste("p=",p,sep=''), lty=1:3, lwd=2, bty='n')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.