Re: [R] How to use "mix" to estimate the parameters for mixture gamma distribution?

From: Ben Bolker <bolker_at_ufl.edu>
Date: Wed, 20 Jun 2007 20:12:09 +0000 (UTC)

Wang, Yun <ywang <at> med.wayne.edu> writes:

>
>
> Dear R users,
>
> Please help me on using "mix" function under package "mixdist".
>
> My data distribution shows there are two components for the mixture
distribution: left part is an
> exponential and right part is a normal. So I plan to use "gamma" mixture
distribution to estimate the
> parameters. Here is what I am using for the "mix" function.
>
> Test<-mix(x, mixparam(mu=c(1,125),sigma=c(1,11.18)),"gamma")
>
> However, one error message shows up as:
> "Error in nlm(function(x) f(x, ...), p, hessian, typsize, fscale, msg, :
missing value in parameter"
>
> Does anybody know what that means and how to fix it to get the estimation?
Your help will be much appreciated.
>
> Yun
>

  You haven't given us enough to go on. First of all, mixdist is a contributed package -- not part of base R, and not even on CRAN (but not too hard to find: http://www.math.mcmaster.ca/peter/mix/mix.html ). You might consider asking the author/maintainer: see help(package="mixdist").

Second, please do as the posting guide suggests and give us a simple, reproducible example. If your data are small enough, you can just post them, or post them to a web site and send the URL -- or make up a small data set that also displays the problem (you will often discover the answer for yourself in the process of doing this!)

  Staring at the C code for nlm (in src/main/optimize.c) suggests that nlm is being passed an NA in a parameter set somewhere -- you might try options(error=recover) to start diagnosing, or change print.level in your mix() call.

  But your best bet is to find a reproducible example for us to look at.

  cheers
    Ben Bolker



R-help_at_stat.math.ethz.ch 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 Wed 20 Jun 2007 - 20:27:23 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 Wed 20 Jun 2007 - 20:33:54 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.