Prob
is a collection of types, constants and utility functions for handling
probabilities in the SRILM library.
TYPES
Prob
A floating point number representing a probability.
LogP
Logarithm to base 10 of a probability.
CONSTANTS
LogP_Zero
Log of probability 0.
LogP_Inf
Log of probability infinity (not a legal probability, of course).
LogP_One
Log of probability 1.
LogP_Precision
The number of significant digits in a LogP
Prob_Epsilon
A positive value close to 0; probability sums less than this should be
considered effectively zero.
FUNCTIONS
Boolean parseLogP(const char *string, LogP &prob)
Converts a floating point string representation into a LogP.
Returns
true
iff the number was parsed correctly.
This function should be much faster than generic C library functions
for floating point parsing.
Also, it parses singular LogP's (plus/minus infinity) correctly.
Computes the LogP resulting from interpolating two LogP's.
If p1 and p2 are probabilities corresponding to prob1
and prob2, respectively, then the result is the LogP corresponding
to lambda * p1 + (1 - lambda) * p2.
The following functions deal with bytelogs.
Bytelogs are logarithms scaled to represent probabilties and likelihoods
as a short integer in SRI's DECIPHER(TM) recognizer
(bytelog(p) = log(p) * 10000.5 / 1024).
double ProbToBytelog(Prob prob)
Converts a probability to a bytelog.
double LogPtoBytelog(LogP prob)
Convert a LogP to a bytelog.
LogP BytelogToLogP(double bytelog)
Convert a bytelog to a LogP.
SEE ALSO
BUGS
AUTHOR
Andreas Stolcke <stolcke@speech.sri.com>.
Copyright 1995, 1996 SRI International