Maximum likelihood of Compound Poisson Distributions
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.
r
add a comment |
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.
r
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (library("sos"); findFn("tweedie")en.wikipedia.org/wiki/…
– Ben Bolker
Nov 14 '18 at 1:37
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40
add a comment |
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.
r
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.
r
r
edited Nov 14 '18 at 1:38
Ben Bolker
133k11223311
133k11223311
asked Nov 13 '18 at 10:16
lina binalina bina
11
11
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (library("sos"); findFn("tweedie")en.wikipedia.org/wiki/…
– Ben Bolker
Nov 14 '18 at 1:37
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40
add a comment |
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (library("sos"); findFn("tweedie")en.wikipedia.org/wiki/…
– Ben Bolker
Nov 14 '18 at 1:37
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (
library("sos"); findFn("tweedie") en.wikipedia.org/wiki/…– Ben Bolker
Nov 14 '18 at 1:37
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (
library("sos"); findFn("tweedie") en.wikipedia.org/wiki/…– Ben Bolker
Nov 14 '18 at 1:37
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40
add a comment |
1 Answer
1
active
oldest
votes
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.
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278682%2fmaximum-likelihood-of-compound-poisson-distributions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
add a comment |
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.
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
add a comment |
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.
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.
edited Nov 14 '18 at 0:44
answered Nov 13 '18 at 11:39
StefanosStefanos
335313
335313
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
add a comment |
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
1
1
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
I don't think this works. NB is a Poisson with Gamma-distributed mean; OP wants a sum of Gammas
– Ben Bolker
Nov 13 '18 at 12:37
It does not work!
– lina bina
Nov 13 '18 at 21:24
It does not work!
– lina bina
Nov 13 '18 at 21:24
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@BenBolker You are right, I had misunderstood the question
– Stefanos
Nov 14 '18 at 0:34
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
@linabina It is working, I just tested it. The problem is that as it appears it doesn't perfectly fit your question. So I will edit my answer.
– Stefanos
Nov 14 '18 at 0:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278682%2fmaximum-likelihood-of-compound-poisson-distributions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This will probably get more useful results on CrossValidated; I'm voting to migrate it there. If I needed to do this, I would do it by brute force/approximation. We know that the distribution of the sum of j Gamma deviates with parameters (shape=k, scale=theta) is Gamma(j * k, theta), so we can define the distribution as a mixture of Gammas: Prob(x|beta,k,theta) = sum_j=0^infty dPois(j|beta)*Gamma(j * k,theta). The problem is that it's an infinite sum - unless there's a closed-form solution you might have to truncate the summation
– Ben Bolker
Nov 14 '18 at 1:35
I would probably look in Bailey's stochastic processes book or Pielou's statistical ecology book (or Johnson/Kotz) for more information about the distribution/what's known about the probability distribution
– Ben Bolker
Nov 14 '18 at 1:36
Wikipedia suggests that this distribution is equivalent to a Tweedie distribution, for which there are resources available in R (
library("sos"); findFn("tweedie")en.wikipedia.org/wiki/…– Ben Bolker
Nov 14 '18 at 1:37
unfortunately this package does not contain a function to estimate this parameters .
– lina bina
Nov 20 '18 at 21:40