>  Docs Center  >  Libraries  >  Beaumont  >  SUMOFSMALLS




  This function calculates the sum of very small numbers in a way that
  avoids computer underflow errors. This is useful in situatioOBns like
  likelihood maximization, where individual terms in the likelihood
  can be very small. The program is vectorized to handle multiple
  sums simultaneously.




  logs: The _natural log_ of the values to sum. NANs are
        treated as missing data. A vector or 2d array. If it is a
        vector, then the sum will be taken over all elements. If it
        is a 2D array, then separate sums will be taken over each row
        of data.


  The _natural log_ of the sum of small numbers


  Calculations are done on logarithms, since they are much larger and
  not susceptible to underflow. The basic calculation is
  Sum(x) = Xmax * Sum(x / xmax)
  the numbers x / xmax can be calculated from the logs.

Modification History

  December 2009: Written by Chris Beaumont

© 2022 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us