Dear All,

I am evaluating the value of loglikelihood and it 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]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to