Re: [R] Difference in mixture normals and one density

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Mon, 04 Apr 2011 10:24:15 -0400

Is something like this what you're looking for?

R> library(nor1mix)
R> nmix2 <- norMix(c(2, 3), sig2=c(25, 4), w=c(.2, .8))
R> dnorMix(1, nmix2) - dnorm(1, 2, 5)

[1] 0.03422146

Andy

> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Jim Silverton
> Sent: Monday, April 04, 2011 10:01 AM
> To: r-help_at_r-project.org
> Subject: Re: [R] Difference in mixture normals and one density
>
> Hello,
> I am trying to find out if R can do the following:
>
> I have a mixture of normals say f = 0.2*Normal(2, 5) + 0.8*Normal(3,2)
> How do I find the difference in the densities at any
> particular point of f
> and at Normal(2,5)?
>
> --
> Thanks,
> Jim.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Notice: This e-mail message, together with any attachme...{{dropped:11}}



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 04 Apr 2011 - 14:33:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Apr 2011 - 14:50:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive