Reputation: 1
I'm trying to compute a maximum likelihood of the compound Poisson-Gamma distribution in R. The distribution is defined by $ \sum_{j=1}^{N} Y_j $ where $Y_n$ is i.i.d sequence independent $gamma(k,\theta)$ values and $N$ is a Poisson distribution with parameter $\beta$. I'm trying to estimate the parameters $\theta$ and $\beta$ without luck.
Upvotes: 0
Views: 428
Reputation: 929
If you wanted to do something similar, but for a negative binomial distribution, then you can use the the function negbin.mle from the package Rfast
y <- rpois(100, 2)
Rfast::negbin.mle(y)
Output
$iters
[1] 5
$loglik
[1] -162.855
$param
success probability number of failures mean
0.9963271 480.1317031 1.7700000
Also if you run the command:
Rfast::negbin.mle
You can see what the function is computing.
You can also check the functions manual with:
?Rfast::negbin.mle
Edit:
Unfortunately I haven't found something that perfectly fits your answer. As Ben states, this answer is for a Poisson with Gamma-distributed mean.
Upvotes: 1