Solved – Compute quantile function from a mixture of Normal distribution

I have this mixture of normal distribution:

$$X sim frac{1}{2}mathcal{N}(mu_{x_1}=10,,sigma_{x_1}^{2}=1)+frac{1}{2}mathcal{N}(mu_{x_2}=13,,sigma_{x_2}^{2}=1)$$
How can i compute the quantile function of this distributionin R?
I have to prove this function:
(1 - pi) * qnorm(y, mu1, sigma1) + pi * qnorm(y, mu2, sigma2)

I'm not sure if this code is correct. Thanks for the help in advance!!

The question has already been discussed here.

Possibly after it's been dealt with in 2011, the following canned solution has become available in R:

library(KScorrect) qmixnorm(.95, c(0,2,5,10), c(1,1,1,1), c(.5,.25,.2,.05)) 

Here, the first entry is the quantile, followed by the vector of means, standard deviations and weights (see

The answer is as in the link:

> qmixnorm(.95, c(0,2,5,10), c(1,1,1,1), c(.5,.25,.2,.05)) [1] 7.745521 

Similar Posts:

Rate this post

Leave a Comment