Displaying 1 result from an estimated 1 matches for "powd".
Did you mean:
pod
2012 Aug 16
1
sum over extremely small numbers
...ends up with the sum of
tiny numbers.
Below is an example: suppose I would like to calculate sum_i (log (sum_j x
[i, j] )), the index of log (x) is in the range, say (-2000, 0). I am aware
that exp(-744.5) will be expressed as 0 in 32 bit R and exp
Is there a way to improve the result?
R example:
powd <- sample(-2000:0, 100, replace=T) # the power of x [i, j]
x <- matrix(exp(powd),10) # the value of x
sum(log(rowSums(x))) # sum
Thank you for your help.
Best wishes,
Jie
[[alternative HTML version deleted]]