[R] separate mixture of gamma and normal (with mixtools or ??)
bgunter.4567 at gmail.com
Tue Jan 24 00:34:33 CET 2017
Fitting multicomponent mixtures distributions -- and 3 is already a
lot of components -- is inherently ill-conditioned. You may need to
reassess your strategy. You might wish to post on stackexchange
instead to discuss such statistical issues.
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Jan 23, 2017 at 2:32 PM, Thomas Petzoldt <thpe at simecol.de> wrote:
> Dear friends,
> I am trying to separate bi- (and sometimes tri-) modal univariate mixtures
> of biological data, where the first component is left bounded (e.g.
> exponential or gamma) and the other(s) approximately Gaussian.
> After checking several packages, I'm not really clear what to do. Here is an
> example with "mixtools" that already works quite good, however, the left
> component is not Gaussian (and not symmetric).
> Any idea about a more adequate function or package for this problem?
> Thanks a lot!
> lambda <- c(0.25, 0.75)
> N <- 200
> ## dist1 ~ gamma (or exponential as a special case)
> #dist1 <- rexp(lambda*N, 1)
> dist1 <- rgamma(lambda*N, 1, 1)
> ## dist2 ~ normal
> dist2 <- rnorm(lambda*N, 12, 2)
> ## mixture
> x <- c(dist1, dist2)
> mix <- spEMsymloc(x, mu0=2, eps=1e-3, verbose=TRUE)
> plot(mix, xlim=c(0, 25))
> Thomas Petzoldt
> TU Dresden, Institute of Hydrobiology
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help