mmiller at mail.usp.edu
2008-Feb-18 16:03 UTC
[R] newbie (me) needs to model distribution as two overlapping gaussians
Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either 1) determine the mean and SD for each of the two distributions OR 2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution In case I'm using the wrong language, my data looks something like this: B <- rnorm(500,40,10) H <- rnorm(500,80,5 ) N <- runif(200,0,99) D <- c(B,H,N) Where B=background, H=hits, N=noise, and D=my observed distribution I have seen analyses like this in the past, but I can't remember what it is called. If somebody out there can point me towards an R function, or even the cannonical name for this kind of model, I think I can write the necessary code. Thanks in advance, Mark
tcornulier
2008-Feb-18 19:48 UTC
[R] newbie (me) needs to model distribution as two overlapping gaussians
Is a finite mixture of 2 gaussians the name you are looking for? This specific model will not deal with your N component however. you can find some functions here: http://cran.r-project.org/web/views/Cluster.html Thomas mmiller at mail.usp.edu wrote:> Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either > > 1) determine the mean and SD for each of the two distributions > > OR > > 2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution > > In case I'm using the wrong language, my data looks something like this: > > B <- rnorm(500,40,10) > H <- rnorm(500,80,5 ) > N <- runif(200,0,99) > D <- c(B,H,N) > > Where B=background, H=hits, N=noise, and D=my observed distribution > > I have seen analyses like this in the past, but I can't remember what it is called. If somebody out there can point me towards an R function, or even the cannonical name for this kind of model, I think I can write the necessary code. > > Thanks in advance, > Mark > > ______________________________________________ > 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. >-- ************************** Thomas Cornulier Mammal Research Institute Polish Academy of Sciences ul. Waszkiewicza 1c 17-230 Bialowieza http://www.zbs.bialowieza.pl/?en tel (0048) 85 682 77 88
David Winsemius
2008-Feb-18 20:36 UTC
[R] newbie (me) needs to model distribution as two overlapping gaussians
<mmiller at mail.usp.edu> wrote in news:BAY105-W146A57D6AFC49F8003C73E8F210 at phx.gbl:> > Recently, I have been working with some data that look like two > overlapping gaussian distributions. I would like to either > > 1) determine the mean and SD for each of the two distributions > > OR > > 2) get some (bayesian ?) statistic that estimates how likely an > observation is to belong to the left-hand or right-hand distribution > > In case I'm using the wrong language, my data looks something like > this: > > B <- rnorm(500,40,10) > H <- rnorm(500,80,5 ) > N <- runif(200,0,99) > D <- c(B,H,N)First hit on <http://www.rseek.org/> with: functions mixture gaussians <http://research.stowers-institute.org/efg/R/Statistics/MixturesOfDistributions/index.htm> Task Views: <http://cran.us.r-project.org/web/views/Cluster.html> <http://cran.r-project.org/web/views/Multivariate.html> <http://cran.r-project.org/web/views/Bayesian.html> nor1mix: Normal (1-d) Mixture Models (S3 Classes and Methods) <http://lib.stat.cmu.edu/R/CRAN/> In the nor1mix documentation, M?chler recommends the mclust package for estimation. -- David Winsemius
Wensui Liu
2008-Feb-19 01:03 UTC
[R] newbie (me) needs to model distribution as two overlapping gaussians
it could be a finite mixture. take a look at flexmix package. On Feb 18, 2008 11:03 AM, <mmiller at mail.usp.edu> wrote:> > Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either > > 1) determine the mean and SD for each of the two distributions > > OR > > 2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution > > In case I'm using the wrong language, my data looks something like this: > > B <- rnorm(500,40,10) > H <- rnorm(500,80,5 ) > N <- runif(200,0,99) > D <- c(B,H,N) > > Where B=background, H=hits, N=noise, and D=my observed distribution > > I have seen analyses like this in the past, but I can't remember what it is called. If somebody out there can point me towards an R function, or even the cannonical name for this kind of model, I think I can write the necessary code. > > Thanks in advance, > Mark > > ______________________________________________ > 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. >-- ==============================WenSui Liu ChoicePoint Precision Marketing Phone: 678-893-9457 Email : wensui.liu at choicepoint.com Blog : statcompute.spaces.live.com
Monica Pisica
2008-Feb-19 18:09 UTC
[R] newbie (me) needs to model distribution as two overlapping gaussians
take a look at: Du, 2002, Master Thesis, http://www.math.mcmaster.ca/peter/mix/Rmix.pdf Macdonald, P., 2003, RMIX routine for R, http://www.math.mcmaster.ca/peter/mix/mix.html I don't think this package was actually posted on CRAN (the mix package on CRAN is a different one as far as i remember) - maybe because Macdonald has also a commercial package - or maybe had .... but you can model your distribution with 2 or maybe more normal or log-normal distributions - as you see fit - and does an ANOVA test to see if your modeling is statistically significant or not. You will get also mean and standard distribution for each of your modeling distributions. Hope this helps, Monica ______________________________________________________________ Message: 41 Date: Mon, 18 Feb 2008 16:03:10 +0000 From: Subject: [R] newbie (me) needs to model distribution as two overlapping gaussians To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either 1) determine the mean and SD for each of the two distributions OR 2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution In case I'm using the wrong language, my data looks something like this: B <- rnorm(500,40,10) H <- rnorm(500,80,5 ) N <- runif(200,0,99) D <- c(B,H,N) Where B=background, H=hits, N=noise, and D=my observed distribution I have seen analyses like this in the past, but I can't remember what it is called. If somebody out there can point me towards an R function, or even the cannonical name for this kind of model, I think I can write the necessary code. Thanks in advance, Mark _________________________________________________________________ [[elided Hotmail spam]]