3 ms·
In R you can just plug in a vector of probabilities directly to get the likelihood. Ie: p = seq(.01, .99, by = .01) y1 = dbinom(7, 47, p) y2 = dnbinom(
by nonbel 9y ago
In R you can just plug in a vector of probabilities directly to get the likelihood. Ie:
p = seq(.01, .99, by = .01)
y1 = dbinom(7, 47, p)
y2 = dnbinom(40, 7, p)
It doesn't matter much for this use case but that will also be much faster. It does simplify the code quite a bit too though.
- RA_Fisher 9y agoThank you for pushing me to see that, indeed I should take advantage of the vectorized aspect of this code!