Reputation: 21757
for example, F(X = 2 | lambda = 2.3) = 0.596
I know 2 and 0.596 and I would like to get lambda.
I know I can do it by numerical approximation algorithms.
However before I manually create a function, is there an existing function that I can simply use?
It is a shame that I have to use numerical method. I had thought there is a popular well known analytic method / close form.
Upvotes: 1
Views: 3116
Reputation: 121127
Optimization is probably the way to go with this.
f <- function(lambda) abs(ppois(2, lambda) - 0.5960388)
optimize(f, c(0, 10))
Or, as Ben B suggested,
f2 <- function(lambda) ppois(2, lambda) - 0.5960388
uniroot(f2, c(0, 10))
Upvotes: 7