Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: truncation problem with an exponential : way around?


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: truncation problem with an exponential : way around?
Date   Thu, 28 Jan 2010 10:17:06 -0800 (PST)

--- On Thu, 28/1/10, László Sándor wrote:
> I ran into a standard problem when coding up an estimator :
> at a point to use simply Bayes' rule, I thought I'd
> calculate proper likelihood from log-likelihood. This broke
> down very fast for any test runs, and now I know why : the
> number got that big that it became meaningless on a computer.
> 
> If I want to keep my code general, so I cannot simply rescale
> this or that variable, what else could I do? What is the
> normal way out? 

The standard way is to keep working on the log-likelihood scale,
so, for example, you would transform Bayes theorem as below:

p(a|b) = p(b|a) p(a)/p(b)
ln[p(a|b)] = ln[p(b|a) p(a)/p(b)]
ln[p(a|b)] = ln[p(b|a)] + ln[p(a)] - ln[p(b)]

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index