[R] Integration of mixed normal distribution

Johannes Radinger johannesradinger at gmail.com
Wed Jan 30 10:19:09 CET 2013


Hi,

I already found a conversation on the integration of a normal
distribution and two
suggested solutions
(https://stat.ethz.ch/pipermail/r-help/2007-January/124008.html):

1) integrate(dnorm, 0,1, mean = 0, sd = 1.2)

and

2) pnorm(1, mean = 0, sd = 1.2) - pnorm(0, mean = 0, sd = 1.2)

where the pnorm-approach is supposed to be faster and with higher precision.

I want to integrate a mixed normal distribution like:
normaldistr_1 * p + normaldistr_2 * (1-p)

where p is between 0 and 1 and the means for both distributions are 0
but the standard deviations differ.

In addition, I want to get the integrals from x to infinity or from -
infinity to x for
the mixed distribution.

Can that be done with high precision in R and if yes how?

best regards,

Johannes



More information about the R-help mailing list