[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Thu, 11 Mar 2004 13:32:54 +0000 
Subject:Re: Optimisation of program using ratios 
From:Stephen Isard 
Volume-ID: 

steve@watchfield.com wrote:

> From this description - yes.  All you need to do to "fix" the problem is
> to using floating point numbers.  So if you are writing your probabilities
> like this
>         1/2
> you "should" write them as
>         1.0s0/2
> See REF ITEMISE/Floating Point for the differences between 0.0s0 and
> 0.0d0.  ( s = single precision, d = double precision )
> 
> When you multiply them together you will imperceptibly lose precision but
> make enormous gains in efficiency.  And by setting popdprecision to
> <false> or <true> you can further tweak the speed/precision tradeoff.

A common practice in statistical language modelling is to convert the
probabilities to log probabilities (and then add, rather than
multiply).  That way you get to deal with manageably large negative
numbers, rather than absurdly small positive ones.

Stephen Isard