Hi Guys, it would be great if you could help me with a MLE problem in R. I am trying to evaluate the maximum likelihood estimates of theta = (a1, b1, a2, b2, P) which defines a mixture of a Poisson distribution and two gamma prior distributions (where the Poisson means have a gamma distribution, actually 2 gammas and P is the mixing factor). The likelihood function for theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 ? P) f(Nij; a2, b2, Eij),} The maximum likelihood estimate of theta is the vector that maximizes the above equation (the values of N and E are given). The authors of the article I read say that the maximization involves an iterative search in the five dimensional parameter space, where each iteration involves computing log[L(theta)] and its first and second-order derivatives. In test runs it is suggested that the maximization typically takes between 5 and 15 iterations from the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 = 4, P 1/3). Now I have done maximization of a gamma-poisson mixture before (1 poisson, 1 gamma) successfully and I could determine correctly alpha (a) and beta(a). But this one above is giving me ridiculously large unusable values (for example P should not be above 1 and sometimes I get values of 500!) or even negative values! I know the values I should be obtaining with my samples shouldn't be far from the staring points. Is there a way to help me solve this issue? Thanks. -- View this message in context: http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8177473 Sent from the R help mailing list archive at Nabble.com.
Franco, You can provide lower and upper bounds on the parameters if you use optim with method="L-BFGS-B". Hth, Ingmar> From: francogrex <francogrex at mail.com> > Date: Fri, 5 Jan 2007 04:54:50 -0800 (PST) > To: <r-help at stat.math.ethz.ch> > Subject: [R] maximum likelihood estimation of 5 parameters > >Hi Guys, it would be great if you could help me with a MLE problem in R. I> am trying to evaluate the maximum likelihood estimates of theta = (a1,b1,> a2, b2, P) which defines a mixture of a Poisson distribution and twogamma> prior distributions (where the Poisson means have a gammadistribution,> actually 2 gammas and P is the mixing factor). The likelihoodfunction for> theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 ? P) f(Nij;a2, b2, Eij),}>The maximum likelihood estimate of theta is the vector that maximizes> theabove equation (the values of N and E are given). The authors of the> articleI read say that the maximization involves an iterative search in the> fivedimensional parameter space, where each iteration involves> computinglog[L(theta)] and its first and second-order derivatives. In test> runs it issuggested that the maximization typically takes between 5 and 15> iterationsfrom the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 > 4, P 1/3). Now I have done maximization of a gamma-poisson mixture before> (1 poisson, 1gamma) successfully and I could determine correctly alpha (a)> and beta(a).But this one above is giving me ridiculously large unusable> values (forexample P should not be above 1 and sometimes I get values of> 500!) or evennegative values! I know the values I should be obtaining with my> samplesshouldn't be far from the staring points. Is there a way to help me> solvethis issue? Thanks. -- View this message in context:> http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364. > html#a8177473Sent from the R help mailing list archive at> Nabble.com.______________________________________________ R-help at stat.math.e> thz.ch mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do> read the posting guide http://www.R-project.org/posting-guide.htmland provide> commented, minimal, self-contained, reproducible code.
Using the inverse logistic transform to replace p by exp(xp)/(1+exp(xp)) allows unconstrained fitting of xp. There may still be problems where xp tends to + or - infinity depending on starting values.>>> francogrex <francogrex at mail.com> 01/05/07 11:54 PM >>>Hi Guys, it would be great if you could help me with a MLE problem in R. I am trying to evaluate the maximum likelihood estimates of theta = (a1, b1, a2, b2, P) which defines a mixture of a Poisson distribution and two gamma prior distributions (where the Poisson means have a gamma distribution, actually 2 gammas and P is the mixing factor). The likelihood function for theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 * P) f(Nij; a2, b2, Eij),} The maximum likelihood estimate of theta is the vector that maximizes the above equation (the values of N and E are given). The authors of the article I read say that the maximization involves an iterative search in the five dimensional parameter space, where each iteration involves computing log[L(theta)] and its first and second-order derivatives. In test runs it is suggested that the maximization typically takes between 5 and 15 iterations from the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 = 4, P 1/3). Now I have done maximization of a gamma-poisson mixture before (1 poisson, 1 gamma) successfully and I could determine correctly alpha (a) and beta(a). But this one above is giving me ridiculously large unusable values (for example P should not be above 1 and sometimes I get values of 500!) or even negative values! I know the values I should be obtaining with my samples shouldn't be far from the staring points. Is there a way to help me solve this issue? Thanks. -- View this message in context: http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8177473 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.