Re: [R] R truncating decimal places

2017-05-22 Thread William Dunlap via R-help
Do not compute the log likelihood as the log of the product of probabilities. Instead compute it as the sum of logs of probabilities. The latter is less likely to underflow (go below c. 0^-309). Most (all?) of the built-in probability density functions have a 'log' argument; when log=TRUE you get

[R] R truncating decimal places

2017-05-22 Thread Andrea Goijman
Hello list, I' trying to estimate a log likelihood function from my data. I apply the mean to all my simulations, and I get something like this: apply(likelihood, c(2, 3, 4), mean,na.rm=TRUE) , , 1 [,1] [,2] [,3] [,4] [,5][,6] [,7] [1,] 0.73162327 0.