loglikelihood.poisson
loglikelihood.poisson, function
def autodiff pure loglikelihood.poisson(lambda: number, k: number): number
Returns the log-likelihood of observing k under a Poisson distribution with
mean lambda.
lambda: mean of the Poisson distribution, must be positive.k: observation, must be a non-negative integer.
Examples
table T = with
[| as Lambda, as K |]
[| 2, 3 |]
[| 5, 0 |]
T.LL = loglikelihood.poisson(T.Lambda, T.K)
show table "Poisson" with
T.Lambda
T.K
T.LL
This produces the following table:
| Lambda | K | LL |
|---|---|---|
| 2 | 3 | -1.712318 |
| 5 | 0 | -5 |