I am working with dmultinom function from the Stats package in R. I am trying to calculate the probability of observing these values:
observed_values <- c(23, 14, 81, 0, 0, 0, 154, 0, 0, 54, 0, 0, 0, 50, 174, 7, 1719, 0, 0, 3, 0, 0, 738, 28, 1653, 17, 77, 2, 44, 242, 59, 0, 0, 23, 108, 14, 268, 22, 0, 22, 25, 0, 0, 268, 213, 0, 377, 10, 0, 200, 91, 0, 0, 0, 1231, 0, 122, 0, 0, 462, 322, 0, 0, 0, 0, 24, 233, 0, 31, 382, 484, 82, 31, 81, 48, 0, 0, 0, 3, 0, 0, 93, 0, 0, 0, 4954, 111, 0, 0, 473)
from these probabilities:
[1] 0.0013982689 0.0059828432 0.0059828432 0.0199428108 0.0059828432 0.0001747836 [7] 0.0518513081 0.0008739181 0.0358970594 0.0179485297 0.0119656865 0.0059828432 [13] 0.0219370919 0.0059828432 0.0006991345 0.0019942811 0.0139599676 0.0239313730 [19] 0.0039885622 0.0001747836 0.0219370919 0.0159542486 0.0119656865 0.0039885622 [25] 0.0038452396 0.0039885622 0.0003495672 0.0290595243 0.0008739181 0.0047191577 [31] 0.0013982689 0.0059828432 0.0059828432 0.0199428108 0.0059828432 0.0001747836 [37] 0.0518513081 0.0008739181 0.0358970594 0.0179485297 0.0119656865 0.0059828432 [43] 0.0219370919 0.0059828432 0.0006991345 0.0019942811 0.0139599676 0.0239313730 [49] 0.0039885622 0.0001747836 0.0219370919 0.0159542486 0.0119656865 0.0039885622 [55] 0.0038452396 0.0039885622 0.0003495672 0.0290595243 0.0008739181 0.0047191577 [61] 0.0013982689 0.0059828432 0.0059828432 0.0199428108 0.0059828432 0.0001747836 [67] 0.0518513081 0.0008739181 0.0358970594 0.0179485297 0.0119656865 0.0059828432 [73] 0.0219370919 0.0059828432 0.0006991345 0.0019942811 0.0139599676 0.0239313730 [79] 0.0039885622 0.0001747836 0.0219370919 0.0159542486 0.0119656865 0.0039885622 [85] 0.0038452396 0.0039885622 0.0003495672 0.0290595243 0.0008739181 0.0047191577
The probability I get from dmultinom is always zero. Any advice on why this is happening ?
Alternatively one could try computing it with different probabilities ( for example a fair multinomial distribution), to try and figure out the issue, but the observed values have to be exactly these ones, since this is from real life biological data.
Any advice would be more than welcome. Any other packages I could use apart from Stats ?
Thank you.
Everything seems to work with data generate randomly from R. but with real life data, it’s not working.
Hasinala Ramangason is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.