Re: Help with BUGS model



On Aug 24, 2:53 pm, vontres...@xxxxxx wrote:
Also, in your code, I don't see the use of the digamma function from
equation 9 or the paper. How did you avoid this? Is there a
constrained minimization package available for R so you could do the
maximum likelihood estimation in equation 12? I picked SAS Proc IML
because they have the digamma function and a minimization routine.


I don't quite understand. It's not the posterior distribution that has
to be maximized but the marginal likelihood given in eq (12) of the
article and also represented like below:
LIK(i->m) | P*fNB(Ni; a1; prob1)+(1-P)*fNB(Ni; a2; prob2)
where prob=b/(b+E)

Estimates of p, a1, b1, a2, and b2 are obtained by maximizing the
likelihood function above. One can do a constraint maximization in R.
To calculate the log(lambda) values then one can use eq(9), but if you
can have the distribution of the lambdas it's more straightforward to
integrate to calculate the percentiles of the posterior:
Integrate (0->x) density(lambda,a1+n,b1+e,a2+n,b2+e,Qn)dlambda



.



Relevant Pages

  • Re: Help with BUGS model
    ... constrained minimization package available for R so you could do the ... It's not the posterior distribution that has ... to be maximized but the marginal likelihood given in eq of the ... One can do a constraint maximization in R. ...
    (sci.stat.math)
  • Re: Help with BUGS model
    ... constrained minimization package available for R so you could do the ... to be maximized but the marginal likelihood given in eq of the ... integrate to calculate the percentiles of the posterior: ... But it's much neater to have the complete distribution which is given ...
    (sci.stat.math)