Generalizing Poisson's binomial distribution to the multinomial case. Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Finding the pmf of a r.v. S ~ Poisson's multinomial distribution.Negative Binomial DistributionNegative binomial distribution - deriving of the p.m.f. combinatoriallyProbability distribution for the number of successes for $N$ distinct trials with distinct probabilities of success and failureBinomial within a multinomial distributionA more general Poisson Binomial DistributionHow to show a possion binomial random variable dominates another possion binomial random variable with a smaller probability value?How can a problem be changed such that it forms a poisson rather than a binomial distribution?Binomial distribution p=1calculating confidence intervals for a weighted binomial distributionDistribution of repeated binomial processes where success probability and number of trials changes each time

Stars Make Stars

ListPlot join points by nearest neighbor rather than order

Why is "Consequences inflicted." not a sentence?

Should gear shift center itself while in neutral?

What are 'alternative tunings' of a guitar and why would you use them? Doesn't it make it more difficult to play?

Should I use Javascript Classes or Apex Classes in Lightning Web Components?

How to deal with a team lead who never gives me credit?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

Does the Giant Rocktopus have a Swim Speed?

Are variable time comparisons always a security risk in cryptography code?

What does the "x" in "x86" represent?

Is it true to say that an hosting provider's DNS server is what links the entire hosting environment to ICANN?

Why are there no cargo aircraft with "flying wing" design?

Is it possible to boil a liquid by just mixing many immiscible liquids together?

Can Pao de Queijo, and similar foods, be kosher for Passover?

Should I call the interviewer directly, if HR aren't responding?

What's the purpose of writing one's academic bio in 3rd person?

Is there a way in Ruby to make just any one out of many keyword arguments required?

Single word antonym of "flightless"

Is the Standard Deduction better than Itemized when both are the same amount?

Why does Python start at index 1 when iterating an array backwards?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

The logistics of corpse disposal

Is there a service that would inform me whenever a new direct route is scheduled from a given airport?



Generalizing Poisson's binomial distribution to the multinomial case.



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Finding the pmf of a r.v. S ~ Poisson's multinomial distribution.Negative Binomial DistributionNegative binomial distribution - deriving of the p.m.f. combinatoriallyProbability distribution for the number of successes for $N$ distinct trials with distinct probabilities of success and failureBinomial within a multinomial distributionA more general Poisson Binomial DistributionHow to show a possion binomial random variable dominates another possion binomial random variable with a smaller probability value?How can a problem be changed such that it forms a poisson rather than a binomial distribution?Binomial distribution p=1calculating confidence intervals for a weighted binomial distributionDistribution of repeated binomial processes where success probability and number of trials changes each time










3












$begingroup$


If in a binomial distribution, the Bernoulli trials are independent and have different success probabilities, then it is called Poisson Binomial Distribution. Such a question has been previously answered here and here.



How can I do a similar analysis in the case of a multinomial distribution? For instance, if a $k$-sided die is thrown $n$ times and the probabilities of each side showing up changes every time instead of being fixed (as in the case of regular multinomial distribution), how can I calculate the probability mass function of such a distribution? We assume that we have access to $mathbbp_i_1^n$ where $mathbbp_i$ is a vector of length $k$ denoted the probability of each of the $k$ sides showing up in the $i^th$ trial.



Note: I have asked this question on stats.stackexchange as well, but I feel it is more pertinent here.










share|cite|improve this question











$endgroup$











  • $begingroup$
    Did you find an answer?
    $endgroup$
    – user509037
    Feb 7 at 19:45










  • $begingroup$
    @user509037 I posted it as an answer.
    $endgroup$
    – shahensha
    Feb 9 at 13:36















3












$begingroup$


If in a binomial distribution, the Bernoulli trials are independent and have different success probabilities, then it is called Poisson Binomial Distribution. Such a question has been previously answered here and here.



How can I do a similar analysis in the case of a multinomial distribution? For instance, if a $k$-sided die is thrown $n$ times and the probabilities of each side showing up changes every time instead of being fixed (as in the case of regular multinomial distribution), how can I calculate the probability mass function of such a distribution? We assume that we have access to $mathbbp_i_1^n$ where $mathbbp_i$ is a vector of length $k$ denoted the probability of each of the $k$ sides showing up in the $i^th$ trial.



Note: I have asked this question on stats.stackexchange as well, but I feel it is more pertinent here.










share|cite|improve this question











$endgroup$











  • $begingroup$
    Did you find an answer?
    $endgroup$
    – user509037
    Feb 7 at 19:45










  • $begingroup$
    @user509037 I posted it as an answer.
    $endgroup$
    – shahensha
    Feb 9 at 13:36













3












3








3


2



$begingroup$


If in a binomial distribution, the Bernoulli trials are independent and have different success probabilities, then it is called Poisson Binomial Distribution. Such a question has been previously answered here and here.



How can I do a similar analysis in the case of a multinomial distribution? For instance, if a $k$-sided die is thrown $n$ times and the probabilities of each side showing up changes every time instead of being fixed (as in the case of regular multinomial distribution), how can I calculate the probability mass function of such a distribution? We assume that we have access to $mathbbp_i_1^n$ where $mathbbp_i$ is a vector of length $k$ denoted the probability of each of the $k$ sides showing up in the $i^th$ trial.



Note: I have asked this question on stats.stackexchange as well, but I feel it is more pertinent here.










share|cite|improve this question











$endgroup$




If in a binomial distribution, the Bernoulli trials are independent and have different success probabilities, then it is called Poisson Binomial Distribution. Such a question has been previously answered here and here.



How can I do a similar analysis in the case of a multinomial distribution? For instance, if a $k$-sided die is thrown $n$ times and the probabilities of each side showing up changes every time instead of being fixed (as in the case of regular multinomial distribution), how can I calculate the probability mass function of such a distribution? We assume that we have access to $mathbbp_i_1^n$ where $mathbbp_i$ is a vector of length $k$ denoted the probability of each of the $k$ sides showing up in the $i^th$ trial.



Note: I have asked this question on stats.stackexchange as well, but I feel it is more pertinent here.







probability-distributions binomial-distribution






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 13 '17 at 12:44









Community

1




1










asked Feb 27 '17 at 19:46









shahenshashahensha

1285




1285











  • $begingroup$
    Did you find an answer?
    $endgroup$
    – user509037
    Feb 7 at 19:45










  • $begingroup$
    @user509037 I posted it as an answer.
    $endgroup$
    – shahensha
    Feb 9 at 13:36
















  • $begingroup$
    Did you find an answer?
    $endgroup$
    – user509037
    Feb 7 at 19:45










  • $begingroup$
    @user509037 I posted it as an answer.
    $endgroup$
    – shahensha
    Feb 9 at 13:36















$begingroup$
Did you find an answer?
$endgroup$
– user509037
Feb 7 at 19:45




$begingroup$
Did you find an answer?
$endgroup$
– user509037
Feb 7 at 19:45












$begingroup$
@user509037 I posted it as an answer.
$endgroup$
– shahensha
Feb 9 at 13:36




$begingroup$
@user509037 I posted it as an answer.
$endgroup$
– shahensha
Feb 9 at 13:36










2 Answers
2






active

oldest

votes


















2












$begingroup$

Preliminary (TL;DR)



Background



In his 1991 publication, Norman C. Beaulieu answered your question w/ what he dubbed, the generalized multinomial distribution (GMD). My explanation will focus on the GMD's utility.



Notation



  • # categories $= c$.

  • # trials $= t$.

  • Random vector $= X = left[beginarrayccccX_1&X_2&cdots&X_cendarrayright]^T$.

  • Category responses after $t$ trials vector $= x = left[beginarrayccccx_1&x_2&cdots&x_cendarrayright]^T$.


    • $sum_k = 1^c x_k = t$.


  • Probability of category response during trial matrix $= p = left[beginarraycccc p_1,1 & p_1,2 & cdots & p_1,c \
    p_2,1 & p_2,2 & cdots & p_2,c \
    vdots & vdots & ddots & vdots \
    p_t,1 & p_t,2 & cdots & p_t,c
    endarrayright]$
    .

  • Pmf of $X = Pleft[X = xright]$.


  • $[c] = left1, 2, cdots, cright$.


  • Multiset of $[c] = ([c], m) = left1^m(1), 2^m(2), cdots, c^m(c)right$.


    • $m(i) = x_i$.



  • Permutations of $([c], m) = mathfrakS_([c], m)$.


    • $cardleft(mathfrakS_([c], m)right) = left(m(1), m(2), cdots, m(c)right)!$.


Pmf of GMD



$$Pleft[X = xright] = sum_mathfraks in mathfrakS_([c], m) leftprod_k = 1^t leftp_k,mathfraks_krightright$$



So far, I've identified it as being the superclass of 7 distributions! Namely...



  • Bernoulli distribution.

  • Uniform distribution.

  • Categorical distribution.

  • Binomial distribution.

  • Multinomial distribution.

  • Poisson's binomial distribution.

  • Generalized multinomial distribution (if your definition of superclass allows self-inclusion).


Examples



Games



  • g1: A 2 sided die is simulated using a fair standard die by assigning faces w/ pips 1 through 3 & 4 through 6 to sides 1 & 2, respectively. The die is biased by etching micro holes into faces w/ pips 1 through 3 s.t. $p_1 = 12/30$ & $p_2 = 18/30$. The 2 sided die is tossed 1 time & the category responses are recorded.

  • g2: Same as g1, accept w/ ideal standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$.

  • g3: Same as g1, accept w/ standard die, i.e., $p_1 = p_2 = p_3 = 4/30$ & $p_4 = p_5 = p_6 = 6/30$.

  • g4: Same as g1, accept die is tossed 7 times.

  • g5: Same as g3, accept die is tossed 7 times.

  • g6: Same as g4, accept the micro holes are filled w/ $0.07$ kg of a material, which evaporates @ $0.01$ kg/s upon being sprayed w/ an activator, s.t. $p_1 = p_2 = 15/30$ for the 1st toss. Immediately after being sprayed, category responses are recorded every second.

  • g7: Same as g6, accept w/ standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$ for the 1st toss.

Questions



  • q1: Find pmf & evaluate when $x = left[beginarraycc0&1endarrayright]^T$.

  • q2: Find pmf & evaluate when $x = left[beginarraycccccc0&1&0&0&0&0endarrayright]^T$.

  • q3: q2.

  • q4: Find pmf & evaluate when $x = left[beginarraycc2&5endarrayright]^T$.

  • q5: Find pmf & evaluate when $x = left[beginarraycccccc0&2&1&1&0&3endarrayright]^T$.

  • q6: q4.

  • q7: q5.

Answers w/o knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^2 fracp_k^kk! = frac1!(12/30)^0(18/30)^10!1!$
      $Longrightarrow Pleft[X = xright] = 3/5$.


  • a2: $X$ ~ Uniform distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(5/30)^0 + 1 + 0 + 0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 1/6$.


  • a3: $X$ ~ Categorical distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(4/30)^0 + 1 + 0(6/30)^0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 2/15$.


  • a4: $X$ ~ Binomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^2 fracp_k^kk! = frac7!(12/30)^2(18/30)^52!5!$
      $Longrightarrow Pleft[X = xright] = 20412/78125$.


  • a5: $X$ ~ Multinomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^6 fracp_k^kk! =
      frac7!(4/30)^0 + 2 + 1(6/30)^1 + 0 + 30!2!1!1!0!3!$

      $Longrightarrow Pleft[X = xright] = 224/140625$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $Pleft[left[beginarrayccX_1&X_2endarrayright]^T = left[beginarrayccx_1&x_2endarrayright]^Tright] = Pleft[X_1 = x_1, X_2 = x_2right] = Pleft[X_1 = x_1right] = Pleft[X_2 = x_2right]$.


    • $p_1$ & $p_2$ are vectors now: $p_1 = left[beginarrayccccp_1_1&p_1_2&cdots&p_1_tendarrayright]^T, p_2 = left[beginarrayccccp_2_1&p_2_2&cdots&p_2_tendarrayright]^T$.


    • $Pleft[X_2 = x_2right] = frac1t + 1sum_i = 0^t leftexpleft(frac-j2pi i x_2t + 1right) prod_k = 1^t leftp_2_kleft(expleft(fracj2pi it + 1right) - 1right) + 1rightright$
      $= frac18sum_i = 0^7 leftexpleft(frac-j5pi i4right) prod_k = 1^7 leftleft(frac0.5k + 14.530right)left(expleft(fracjpi i4right) - 1right) + 1rightright$
      $Longrightarrow Pleft[X_2 = 5right] = 308327/1440000$.


  • a7: $X$ ~ Generalized multinomial distribution.

    • ???


Answers w/ Knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $p = left[beginarraycfrac1230&frac1830endarrayright]$.


    • $mathfrakS_([2], m) = leftleft(2right)right$.


  • a2: $X$ ~ Uniform distribution.


    • $p = left[beginarraycfrac530&frac530&frac530&frac530&frac530&frac530endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a3: $X$ ~ Categorical distribution.


    • $p = left[beginarraycfrac430&frac430&frac430&frac630&frac630&frac630endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a4: $X$ ~ Binomial distribution.


    • $p = left[beginarraycc
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a5: $X$ ~ Multinomial distribution.


    • $p = left[beginarraycccccc
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $p = left[beginarraycc
      frac1530&frac1530 \
      frac14.530&frac15.530 \
      frac1430&frac1630 \
      frac13.530&frac16.530 \
      frac1330&frac1730 \
      frac12.530&frac17.530 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a7: $X$ ~ Generalized multinomial distribution.


    • $p = left[beginarraycccccc
      frac530&frac530&frac530&frac530&frac530&frac530 \
      frac4.8overline330&frac4.8overline330&frac4.8overline330
      &frac5.1overline630&frac5.1overline630&frac5.1overline630 \
      frac4.overline630&frac4.overline630&frac4.overline630
      &frac5.overline330&frac5.overline330&frac5.overline330 \
      frac4.530&frac4.530&frac4.530
      &frac5.530&frac5.530&frac5.530 \
      frac4.overline330&frac4.overline330&frac4.overline330
      &frac5.overline630&frac5.overline630&frac5.overline630 \
      frac4.1overline630&frac4.1overline630&frac4.1overline630
      &frac5.8overline330&frac5.8overline330&frac5.8overline330 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


    • $Pleft[X = xright] = 59251/36905625$.



Final Words



I know my answer was very long (& went far beyond what OP asked for) but this had been flying around inside my head for quite some time & this q seemed like the most suitable landing strip.



I performed the last 6 calculations using the function gmdPmf (which I defined in Mathematica)...



(* GENERALIZED MULTINOMIAL DISTRIBUTION (GMD) *)
(* Note: mXn = # rows X # columns. *)
gmdPmf[
x_ (* Responses of category j, after t trials have taken place. *),
p_ (* Matrix (tXm) holds p_trial i, category j = P["Response of trial i is category j"]. *)
] := Module[t, c, ⦋c⦌, allRPs, desiredRPs, count = 0, sum = 0, product = 1,
t = Total[x]; (* # trials. *)
c = Length[x]; (* # categories. *)
⦋c⦌ = Range[c]; (* Categories. *)
allRPs = Tuples[⦋c⦌,t]; (* Matrix (c^tXt) holds all the response patterns given that t trials have occurred. *)
desiredRPs = ; (* Matrix ((x_1,x_2,...,x_c) !Xt) holds the desired response patterns; subset of allRPs wrt n. *)

For[i = 1, i <= Length[allRPs], i++,
For[j = 1, j <= c, j++, If[Count[allRPs[[i]],⦋c⦌[[j]]] == x[[j]], count++];];
If[count == c, AppendTo[desiredRPs, allRPs[[i]]]];
count = 0;
];

For[i = 1, i <= Length[desiredRPs], i++,
For[j = 1, j <= t, j++, product *= (p[[j]][[desiredRPs[[i]][[j]]]]);];
sum += product;
product = 1;
];

sum
];

(* ANSWERS *)
Print["a1: P[X = x] = ", gmdPmf[0, 1, 12/30, 18/30], "."];
Print["a2: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 5/30, 5/30, 5/30, 5/30, 5/30, 5/30], "."];
Print["a3: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 4/30, 4/30, 4/30, 6/30, 6/30, 6/30], "."];
Print["a4: P[X = x] = ", gmdPmf[2, 5, ArrayFlatten[ConstantArray[12/30, 18/30, 7, 1]]], "."];
Print["a5: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, ArrayFlatten[ConstantArray[4/30, 4/30, 4/30, 6/30, 6/30, 6/30, 7, 1]]], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/2) - (1/2)*i)/30; r = ((29/2) + (1/2)*i)/30; AppendTo[p,l,r];]; Print["a6: P[X = x] = ", gmdPmf[2, 5, p], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/6) - (1/6)*i)/30; r = ((29/6) + (1/6)*i)/30; AppendTo[p,l,l,l,r,r,r];]; Print["a7: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, p], "."];

Clear[gmdPmf];


Please edit, if you know of any ways to make it shorter/faster. Congrats, if you made it to the end! (:






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
    $endgroup$
    – Landon
    Mar 26 at 5:40










  • $begingroup$
    Great. Thank you very much.
    $endgroup$
    – shahensha
    Mar 28 at 10:02


















1












$begingroup$

I have come across very few resources on the topic. Such a problem is called Generalized Poisson's distribution or GPB. I am listing a few of them here to help others.



  1. An old paper describing the calculation of its approximate pdf.

  2. A 2018 paper describing an algorithm to compute its PDF using Fourier Transforms.

  3. An R package implementing the same.





share|cite|improve this answer









$endgroup$












  • $begingroup$
    This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
    $endgroup$
    – Landon
    Mar 23 at 22:12










  • $begingroup$
    Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
    $endgroup$
    – shahensha
    Mar 24 at 9:37











  • $begingroup$
    Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
    $endgroup$
    – Landon
    Mar 24 at 11:37










  • $begingroup$
    I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
    $endgroup$
    – Landon
    Mar 24 at 11:42










  • $begingroup$
    Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
    $endgroup$
    – Landon
    Mar 24 at 11:46











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
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
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2164222%2fgeneralizing-poissons-binomial-distribution-to-the-multinomial-case%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2












$begingroup$

Preliminary (TL;DR)



Background



In his 1991 publication, Norman C. Beaulieu answered your question w/ what he dubbed, the generalized multinomial distribution (GMD). My explanation will focus on the GMD's utility.



Notation



  • # categories $= c$.

  • # trials $= t$.

  • Random vector $= X = left[beginarrayccccX_1&X_2&cdots&X_cendarrayright]^T$.

  • Category responses after $t$ trials vector $= x = left[beginarrayccccx_1&x_2&cdots&x_cendarrayright]^T$.


    • $sum_k = 1^c x_k = t$.


  • Probability of category response during trial matrix $= p = left[beginarraycccc p_1,1 & p_1,2 & cdots & p_1,c \
    p_2,1 & p_2,2 & cdots & p_2,c \
    vdots & vdots & ddots & vdots \
    p_t,1 & p_t,2 & cdots & p_t,c
    endarrayright]$
    .

  • Pmf of $X = Pleft[X = xright]$.


  • $[c] = left1, 2, cdots, cright$.


  • Multiset of $[c] = ([c], m) = left1^m(1), 2^m(2), cdots, c^m(c)right$.


    • $m(i) = x_i$.



  • Permutations of $([c], m) = mathfrakS_([c], m)$.


    • $cardleft(mathfrakS_([c], m)right) = left(m(1), m(2), cdots, m(c)right)!$.


Pmf of GMD



$$Pleft[X = xright] = sum_mathfraks in mathfrakS_([c], m) leftprod_k = 1^t leftp_k,mathfraks_krightright$$



So far, I've identified it as being the superclass of 7 distributions! Namely...



  • Bernoulli distribution.

  • Uniform distribution.

  • Categorical distribution.

  • Binomial distribution.

  • Multinomial distribution.

  • Poisson's binomial distribution.

  • Generalized multinomial distribution (if your definition of superclass allows self-inclusion).


Examples



Games



  • g1: A 2 sided die is simulated using a fair standard die by assigning faces w/ pips 1 through 3 & 4 through 6 to sides 1 & 2, respectively. The die is biased by etching micro holes into faces w/ pips 1 through 3 s.t. $p_1 = 12/30$ & $p_2 = 18/30$. The 2 sided die is tossed 1 time & the category responses are recorded.

  • g2: Same as g1, accept w/ ideal standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$.

  • g3: Same as g1, accept w/ standard die, i.e., $p_1 = p_2 = p_3 = 4/30$ & $p_4 = p_5 = p_6 = 6/30$.

  • g4: Same as g1, accept die is tossed 7 times.

  • g5: Same as g3, accept die is tossed 7 times.

  • g6: Same as g4, accept the micro holes are filled w/ $0.07$ kg of a material, which evaporates @ $0.01$ kg/s upon being sprayed w/ an activator, s.t. $p_1 = p_2 = 15/30$ for the 1st toss. Immediately after being sprayed, category responses are recorded every second.

  • g7: Same as g6, accept w/ standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$ for the 1st toss.

Questions



  • q1: Find pmf & evaluate when $x = left[beginarraycc0&1endarrayright]^T$.

  • q2: Find pmf & evaluate when $x = left[beginarraycccccc0&1&0&0&0&0endarrayright]^T$.

  • q3: q2.

  • q4: Find pmf & evaluate when $x = left[beginarraycc2&5endarrayright]^T$.

  • q5: Find pmf & evaluate when $x = left[beginarraycccccc0&2&1&1&0&3endarrayright]^T$.

  • q6: q4.

  • q7: q5.

Answers w/o knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^2 fracp_k^kk! = frac1!(12/30)^0(18/30)^10!1!$
      $Longrightarrow Pleft[X = xright] = 3/5$.


  • a2: $X$ ~ Uniform distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(5/30)^0 + 1 + 0 + 0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 1/6$.


  • a3: $X$ ~ Categorical distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(4/30)^0 + 1 + 0(6/30)^0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 2/15$.


  • a4: $X$ ~ Binomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^2 fracp_k^kk! = frac7!(12/30)^2(18/30)^52!5!$
      $Longrightarrow Pleft[X = xright] = 20412/78125$.


  • a5: $X$ ~ Multinomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^6 fracp_k^kk! =
      frac7!(4/30)^0 + 2 + 1(6/30)^1 + 0 + 30!2!1!1!0!3!$

      $Longrightarrow Pleft[X = xright] = 224/140625$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $Pleft[left[beginarrayccX_1&X_2endarrayright]^T = left[beginarrayccx_1&x_2endarrayright]^Tright] = Pleft[X_1 = x_1, X_2 = x_2right] = Pleft[X_1 = x_1right] = Pleft[X_2 = x_2right]$.


    • $p_1$ & $p_2$ are vectors now: $p_1 = left[beginarrayccccp_1_1&p_1_2&cdots&p_1_tendarrayright]^T, p_2 = left[beginarrayccccp_2_1&p_2_2&cdots&p_2_tendarrayright]^T$.


    • $Pleft[X_2 = x_2right] = frac1t + 1sum_i = 0^t leftexpleft(frac-j2pi i x_2t + 1right) prod_k = 1^t leftp_2_kleft(expleft(fracj2pi it + 1right) - 1right) + 1rightright$
      $= frac18sum_i = 0^7 leftexpleft(frac-j5pi i4right) prod_k = 1^7 leftleft(frac0.5k + 14.530right)left(expleft(fracjpi i4right) - 1right) + 1rightright$
      $Longrightarrow Pleft[X_2 = 5right] = 308327/1440000$.


  • a7: $X$ ~ Generalized multinomial distribution.

    • ???


Answers w/ Knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $p = left[beginarraycfrac1230&frac1830endarrayright]$.


    • $mathfrakS_([2], m) = leftleft(2right)right$.


  • a2: $X$ ~ Uniform distribution.


    • $p = left[beginarraycfrac530&frac530&frac530&frac530&frac530&frac530endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a3: $X$ ~ Categorical distribution.


    • $p = left[beginarraycfrac430&frac430&frac430&frac630&frac630&frac630endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a4: $X$ ~ Binomial distribution.


    • $p = left[beginarraycc
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a5: $X$ ~ Multinomial distribution.


    • $p = left[beginarraycccccc
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $p = left[beginarraycc
      frac1530&frac1530 \
      frac14.530&frac15.530 \
      frac1430&frac1630 \
      frac13.530&frac16.530 \
      frac1330&frac1730 \
      frac12.530&frac17.530 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a7: $X$ ~ Generalized multinomial distribution.


    • $p = left[beginarraycccccc
      frac530&frac530&frac530&frac530&frac530&frac530 \
      frac4.8overline330&frac4.8overline330&frac4.8overline330
      &frac5.1overline630&frac5.1overline630&frac5.1overline630 \
      frac4.overline630&frac4.overline630&frac4.overline630
      &frac5.overline330&frac5.overline330&frac5.overline330 \
      frac4.530&frac4.530&frac4.530
      &frac5.530&frac5.530&frac5.530 \
      frac4.overline330&frac4.overline330&frac4.overline330
      &frac5.overline630&frac5.overline630&frac5.overline630 \
      frac4.1overline630&frac4.1overline630&frac4.1overline630
      &frac5.8overline330&frac5.8overline330&frac5.8overline330 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


    • $Pleft[X = xright] = 59251/36905625$.



Final Words



I know my answer was very long (& went far beyond what OP asked for) but this had been flying around inside my head for quite some time & this q seemed like the most suitable landing strip.



I performed the last 6 calculations using the function gmdPmf (which I defined in Mathematica)...



(* GENERALIZED MULTINOMIAL DISTRIBUTION (GMD) *)
(* Note: mXn = # rows X # columns. *)
gmdPmf[
x_ (* Responses of category j, after t trials have taken place. *),
p_ (* Matrix (tXm) holds p_trial i, category j = P["Response of trial i is category j"]. *)
] := Module[t, c, ⦋c⦌, allRPs, desiredRPs, count = 0, sum = 0, product = 1,
t = Total[x]; (* # trials. *)
c = Length[x]; (* # categories. *)
⦋c⦌ = Range[c]; (* Categories. *)
allRPs = Tuples[⦋c⦌,t]; (* Matrix (c^tXt) holds all the response patterns given that t trials have occurred. *)
desiredRPs = ; (* Matrix ((x_1,x_2,...,x_c) !Xt) holds the desired response patterns; subset of allRPs wrt n. *)

For[i = 1, i <= Length[allRPs], i++,
For[j = 1, j <= c, j++, If[Count[allRPs[[i]],⦋c⦌[[j]]] == x[[j]], count++];];
If[count == c, AppendTo[desiredRPs, allRPs[[i]]]];
count = 0;
];

For[i = 1, i <= Length[desiredRPs], i++,
For[j = 1, j <= t, j++, product *= (p[[j]][[desiredRPs[[i]][[j]]]]);];
sum += product;
product = 1;
];

sum
];

(* ANSWERS *)
Print["a1: P[X = x] = ", gmdPmf[0, 1, 12/30, 18/30], "."];
Print["a2: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 5/30, 5/30, 5/30, 5/30, 5/30, 5/30], "."];
Print["a3: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 4/30, 4/30, 4/30, 6/30, 6/30, 6/30], "."];
Print["a4: P[X = x] = ", gmdPmf[2, 5, ArrayFlatten[ConstantArray[12/30, 18/30, 7, 1]]], "."];
Print["a5: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, ArrayFlatten[ConstantArray[4/30, 4/30, 4/30, 6/30, 6/30, 6/30, 7, 1]]], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/2) - (1/2)*i)/30; r = ((29/2) + (1/2)*i)/30; AppendTo[p,l,r];]; Print["a6: P[X = x] = ", gmdPmf[2, 5, p], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/6) - (1/6)*i)/30; r = ((29/6) + (1/6)*i)/30; AppendTo[p,l,l,l,r,r,r];]; Print["a7: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, p], "."];

Clear[gmdPmf];


Please edit, if you know of any ways to make it shorter/faster. Congrats, if you made it to the end! (:






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
    $endgroup$
    – Landon
    Mar 26 at 5:40










  • $begingroup$
    Great. Thank you very much.
    $endgroup$
    – shahensha
    Mar 28 at 10:02















2












$begingroup$

Preliminary (TL;DR)



Background



In his 1991 publication, Norman C. Beaulieu answered your question w/ what he dubbed, the generalized multinomial distribution (GMD). My explanation will focus on the GMD's utility.



Notation



  • # categories $= c$.

  • # trials $= t$.

  • Random vector $= X = left[beginarrayccccX_1&X_2&cdots&X_cendarrayright]^T$.

  • Category responses after $t$ trials vector $= x = left[beginarrayccccx_1&x_2&cdots&x_cendarrayright]^T$.


    • $sum_k = 1^c x_k = t$.


  • Probability of category response during trial matrix $= p = left[beginarraycccc p_1,1 & p_1,2 & cdots & p_1,c \
    p_2,1 & p_2,2 & cdots & p_2,c \
    vdots & vdots & ddots & vdots \
    p_t,1 & p_t,2 & cdots & p_t,c
    endarrayright]$
    .

  • Pmf of $X = Pleft[X = xright]$.


  • $[c] = left1, 2, cdots, cright$.


  • Multiset of $[c] = ([c], m) = left1^m(1), 2^m(2), cdots, c^m(c)right$.


    • $m(i) = x_i$.



  • Permutations of $([c], m) = mathfrakS_([c], m)$.


    • $cardleft(mathfrakS_([c], m)right) = left(m(1), m(2), cdots, m(c)right)!$.


Pmf of GMD



$$Pleft[X = xright] = sum_mathfraks in mathfrakS_([c], m) leftprod_k = 1^t leftp_k,mathfraks_krightright$$



So far, I've identified it as being the superclass of 7 distributions! Namely...



  • Bernoulli distribution.

  • Uniform distribution.

  • Categorical distribution.

  • Binomial distribution.

  • Multinomial distribution.

  • Poisson's binomial distribution.

  • Generalized multinomial distribution (if your definition of superclass allows self-inclusion).


Examples



Games



  • g1: A 2 sided die is simulated using a fair standard die by assigning faces w/ pips 1 through 3 & 4 through 6 to sides 1 & 2, respectively. The die is biased by etching micro holes into faces w/ pips 1 through 3 s.t. $p_1 = 12/30$ & $p_2 = 18/30$. The 2 sided die is tossed 1 time & the category responses are recorded.

  • g2: Same as g1, accept w/ ideal standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$.

  • g3: Same as g1, accept w/ standard die, i.e., $p_1 = p_2 = p_3 = 4/30$ & $p_4 = p_5 = p_6 = 6/30$.

  • g4: Same as g1, accept die is tossed 7 times.

  • g5: Same as g3, accept die is tossed 7 times.

  • g6: Same as g4, accept the micro holes are filled w/ $0.07$ kg of a material, which evaporates @ $0.01$ kg/s upon being sprayed w/ an activator, s.t. $p_1 = p_2 = 15/30$ for the 1st toss. Immediately after being sprayed, category responses are recorded every second.

  • g7: Same as g6, accept w/ standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$ for the 1st toss.

Questions



  • q1: Find pmf & evaluate when $x = left[beginarraycc0&1endarrayright]^T$.

  • q2: Find pmf & evaluate when $x = left[beginarraycccccc0&1&0&0&0&0endarrayright]^T$.

  • q3: q2.

  • q4: Find pmf & evaluate when $x = left[beginarraycc2&5endarrayright]^T$.

  • q5: Find pmf & evaluate when $x = left[beginarraycccccc0&2&1&1&0&3endarrayright]^T$.

  • q6: q4.

  • q7: q5.

Answers w/o knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^2 fracp_k^kk! = frac1!(12/30)^0(18/30)^10!1!$
      $Longrightarrow Pleft[X = xright] = 3/5$.


  • a2: $X$ ~ Uniform distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(5/30)^0 + 1 + 0 + 0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 1/6$.


  • a3: $X$ ~ Categorical distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(4/30)^0 + 1 + 0(6/30)^0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 2/15$.


  • a4: $X$ ~ Binomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^2 fracp_k^kk! = frac7!(12/30)^2(18/30)^52!5!$
      $Longrightarrow Pleft[X = xright] = 20412/78125$.


  • a5: $X$ ~ Multinomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^6 fracp_k^kk! =
      frac7!(4/30)^0 + 2 + 1(6/30)^1 + 0 + 30!2!1!1!0!3!$

      $Longrightarrow Pleft[X = xright] = 224/140625$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $Pleft[left[beginarrayccX_1&X_2endarrayright]^T = left[beginarrayccx_1&x_2endarrayright]^Tright] = Pleft[X_1 = x_1, X_2 = x_2right] = Pleft[X_1 = x_1right] = Pleft[X_2 = x_2right]$.


    • $p_1$ & $p_2$ are vectors now: $p_1 = left[beginarrayccccp_1_1&p_1_2&cdots&p_1_tendarrayright]^T, p_2 = left[beginarrayccccp_2_1&p_2_2&cdots&p_2_tendarrayright]^T$.


    • $Pleft[X_2 = x_2right] = frac1t + 1sum_i = 0^t leftexpleft(frac-j2pi i x_2t + 1right) prod_k = 1^t leftp_2_kleft(expleft(fracj2pi it + 1right) - 1right) + 1rightright$
      $= frac18sum_i = 0^7 leftexpleft(frac-j5pi i4right) prod_k = 1^7 leftleft(frac0.5k + 14.530right)left(expleft(fracjpi i4right) - 1right) + 1rightright$
      $Longrightarrow Pleft[X_2 = 5right] = 308327/1440000$.


  • a7: $X$ ~ Generalized multinomial distribution.

    • ???


Answers w/ Knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $p = left[beginarraycfrac1230&frac1830endarrayright]$.


    • $mathfrakS_([2], m) = leftleft(2right)right$.


  • a2: $X$ ~ Uniform distribution.


    • $p = left[beginarraycfrac530&frac530&frac530&frac530&frac530&frac530endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a3: $X$ ~ Categorical distribution.


    • $p = left[beginarraycfrac430&frac430&frac430&frac630&frac630&frac630endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a4: $X$ ~ Binomial distribution.


    • $p = left[beginarraycc
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a5: $X$ ~ Multinomial distribution.


    • $p = left[beginarraycccccc
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $p = left[beginarraycc
      frac1530&frac1530 \
      frac14.530&frac15.530 \
      frac1430&frac1630 \
      frac13.530&frac16.530 \
      frac1330&frac1730 \
      frac12.530&frac17.530 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a7: $X$ ~ Generalized multinomial distribution.


    • $p = left[beginarraycccccc
      frac530&frac530&frac530&frac530&frac530&frac530 \
      frac4.8overline330&frac4.8overline330&frac4.8overline330
      &frac5.1overline630&frac5.1overline630&frac5.1overline630 \
      frac4.overline630&frac4.overline630&frac4.overline630
      &frac5.overline330&frac5.overline330&frac5.overline330 \
      frac4.530&frac4.530&frac4.530
      &frac5.530&frac5.530&frac5.530 \
      frac4.overline330&frac4.overline330&frac4.overline330
      &frac5.overline630&frac5.overline630&frac5.overline630 \
      frac4.1overline630&frac4.1overline630&frac4.1overline630
      &frac5.8overline330&frac5.8overline330&frac5.8overline330 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


    • $Pleft[X = xright] = 59251/36905625$.



Final Words



I know my answer was very long (& went far beyond what OP asked for) but this had been flying around inside my head for quite some time & this q seemed like the most suitable landing strip.



I performed the last 6 calculations using the function gmdPmf (which I defined in Mathematica)...



(* GENERALIZED MULTINOMIAL DISTRIBUTION (GMD) *)
(* Note: mXn = # rows X # columns. *)
gmdPmf[
x_ (* Responses of category j, after t trials have taken place. *),
p_ (* Matrix (tXm) holds p_trial i, category j = P["Response of trial i is category j"]. *)
] := Module[t, c, ⦋c⦌, allRPs, desiredRPs, count = 0, sum = 0, product = 1,
t = Total[x]; (* # trials. *)
c = Length[x]; (* # categories. *)
⦋c⦌ = Range[c]; (* Categories. *)
allRPs = Tuples[⦋c⦌,t]; (* Matrix (c^tXt) holds all the response patterns given that t trials have occurred. *)
desiredRPs = ; (* Matrix ((x_1,x_2,...,x_c) !Xt) holds the desired response patterns; subset of allRPs wrt n. *)

For[i = 1, i <= Length[allRPs], i++,
For[j = 1, j <= c, j++, If[Count[allRPs[[i]],⦋c⦌[[j]]] == x[[j]], count++];];
If[count == c, AppendTo[desiredRPs, allRPs[[i]]]];
count = 0;
];

For[i = 1, i <= Length[desiredRPs], i++,
For[j = 1, j <= t, j++, product *= (p[[j]][[desiredRPs[[i]][[j]]]]);];
sum += product;
product = 1;
];

sum
];

(* ANSWERS *)
Print["a1: P[X = x] = ", gmdPmf[0, 1, 12/30, 18/30], "."];
Print["a2: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 5/30, 5/30, 5/30, 5/30, 5/30, 5/30], "."];
Print["a3: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 4/30, 4/30, 4/30, 6/30, 6/30, 6/30], "."];
Print["a4: P[X = x] = ", gmdPmf[2, 5, ArrayFlatten[ConstantArray[12/30, 18/30, 7, 1]]], "."];
Print["a5: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, ArrayFlatten[ConstantArray[4/30, 4/30, 4/30, 6/30, 6/30, 6/30, 7, 1]]], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/2) - (1/2)*i)/30; r = ((29/2) + (1/2)*i)/30; AppendTo[p,l,r];]; Print["a6: P[X = x] = ", gmdPmf[2, 5, p], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/6) - (1/6)*i)/30; r = ((29/6) + (1/6)*i)/30; AppendTo[p,l,l,l,r,r,r];]; Print["a7: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, p], "."];

Clear[gmdPmf];


Please edit, if you know of any ways to make it shorter/faster. Congrats, if you made it to the end! (:






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
    $endgroup$
    – Landon
    Mar 26 at 5:40










  • $begingroup$
    Great. Thank you very much.
    $endgroup$
    – shahensha
    Mar 28 at 10:02













2












2








2





$begingroup$

Preliminary (TL;DR)



Background



In his 1991 publication, Norman C. Beaulieu answered your question w/ what he dubbed, the generalized multinomial distribution (GMD). My explanation will focus on the GMD's utility.



Notation



  • # categories $= c$.

  • # trials $= t$.

  • Random vector $= X = left[beginarrayccccX_1&X_2&cdots&X_cendarrayright]^T$.

  • Category responses after $t$ trials vector $= x = left[beginarrayccccx_1&x_2&cdots&x_cendarrayright]^T$.


    • $sum_k = 1^c x_k = t$.


  • Probability of category response during trial matrix $= p = left[beginarraycccc p_1,1 & p_1,2 & cdots & p_1,c \
    p_2,1 & p_2,2 & cdots & p_2,c \
    vdots & vdots & ddots & vdots \
    p_t,1 & p_t,2 & cdots & p_t,c
    endarrayright]$
    .

  • Pmf of $X = Pleft[X = xright]$.


  • $[c] = left1, 2, cdots, cright$.


  • Multiset of $[c] = ([c], m) = left1^m(1), 2^m(2), cdots, c^m(c)right$.


    • $m(i) = x_i$.



  • Permutations of $([c], m) = mathfrakS_([c], m)$.


    • $cardleft(mathfrakS_([c], m)right) = left(m(1), m(2), cdots, m(c)right)!$.


Pmf of GMD



$$Pleft[X = xright] = sum_mathfraks in mathfrakS_([c], m) leftprod_k = 1^t leftp_k,mathfraks_krightright$$



So far, I've identified it as being the superclass of 7 distributions! Namely...



  • Bernoulli distribution.

  • Uniform distribution.

  • Categorical distribution.

  • Binomial distribution.

  • Multinomial distribution.

  • Poisson's binomial distribution.

  • Generalized multinomial distribution (if your definition of superclass allows self-inclusion).


Examples



Games



  • g1: A 2 sided die is simulated using a fair standard die by assigning faces w/ pips 1 through 3 & 4 through 6 to sides 1 & 2, respectively. The die is biased by etching micro holes into faces w/ pips 1 through 3 s.t. $p_1 = 12/30$ & $p_2 = 18/30$. The 2 sided die is tossed 1 time & the category responses are recorded.

  • g2: Same as g1, accept w/ ideal standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$.

  • g3: Same as g1, accept w/ standard die, i.e., $p_1 = p_2 = p_3 = 4/30$ & $p_4 = p_5 = p_6 = 6/30$.

  • g4: Same as g1, accept die is tossed 7 times.

  • g5: Same as g3, accept die is tossed 7 times.

  • g6: Same as g4, accept the micro holes are filled w/ $0.07$ kg of a material, which evaporates @ $0.01$ kg/s upon being sprayed w/ an activator, s.t. $p_1 = p_2 = 15/30$ for the 1st toss. Immediately after being sprayed, category responses are recorded every second.

  • g7: Same as g6, accept w/ standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$ for the 1st toss.

Questions



  • q1: Find pmf & evaluate when $x = left[beginarraycc0&1endarrayright]^T$.

  • q2: Find pmf & evaluate when $x = left[beginarraycccccc0&1&0&0&0&0endarrayright]^T$.

  • q3: q2.

  • q4: Find pmf & evaluate when $x = left[beginarraycc2&5endarrayright]^T$.

  • q5: Find pmf & evaluate when $x = left[beginarraycccccc0&2&1&1&0&3endarrayright]^T$.

  • q6: q4.

  • q7: q5.

Answers w/o knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^2 fracp_k^kk! = frac1!(12/30)^0(18/30)^10!1!$
      $Longrightarrow Pleft[X = xright] = 3/5$.


  • a2: $X$ ~ Uniform distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(5/30)^0 + 1 + 0 + 0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 1/6$.


  • a3: $X$ ~ Categorical distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(4/30)^0 + 1 + 0(6/30)^0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 2/15$.


  • a4: $X$ ~ Binomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^2 fracp_k^kk! = frac7!(12/30)^2(18/30)^52!5!$
      $Longrightarrow Pleft[X = xright] = 20412/78125$.


  • a5: $X$ ~ Multinomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^6 fracp_k^kk! =
      frac7!(4/30)^0 + 2 + 1(6/30)^1 + 0 + 30!2!1!1!0!3!$

      $Longrightarrow Pleft[X = xright] = 224/140625$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $Pleft[left[beginarrayccX_1&X_2endarrayright]^T = left[beginarrayccx_1&x_2endarrayright]^Tright] = Pleft[X_1 = x_1, X_2 = x_2right] = Pleft[X_1 = x_1right] = Pleft[X_2 = x_2right]$.


    • $p_1$ & $p_2$ are vectors now: $p_1 = left[beginarrayccccp_1_1&p_1_2&cdots&p_1_tendarrayright]^T, p_2 = left[beginarrayccccp_2_1&p_2_2&cdots&p_2_tendarrayright]^T$.


    • $Pleft[X_2 = x_2right] = frac1t + 1sum_i = 0^t leftexpleft(frac-j2pi i x_2t + 1right) prod_k = 1^t leftp_2_kleft(expleft(fracj2pi it + 1right) - 1right) + 1rightright$
      $= frac18sum_i = 0^7 leftexpleft(frac-j5pi i4right) prod_k = 1^7 leftleft(frac0.5k + 14.530right)left(expleft(fracjpi i4right) - 1right) + 1rightright$
      $Longrightarrow Pleft[X_2 = 5right] = 308327/1440000$.


  • a7: $X$ ~ Generalized multinomial distribution.

    • ???


Answers w/ Knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $p = left[beginarraycfrac1230&frac1830endarrayright]$.


    • $mathfrakS_([2], m) = leftleft(2right)right$.


  • a2: $X$ ~ Uniform distribution.


    • $p = left[beginarraycfrac530&frac530&frac530&frac530&frac530&frac530endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a3: $X$ ~ Categorical distribution.


    • $p = left[beginarraycfrac430&frac430&frac430&frac630&frac630&frac630endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a4: $X$ ~ Binomial distribution.


    • $p = left[beginarraycc
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a5: $X$ ~ Multinomial distribution.


    • $p = left[beginarraycccccc
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $p = left[beginarraycc
      frac1530&frac1530 \
      frac14.530&frac15.530 \
      frac1430&frac1630 \
      frac13.530&frac16.530 \
      frac1330&frac1730 \
      frac12.530&frac17.530 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a7: $X$ ~ Generalized multinomial distribution.


    • $p = left[beginarraycccccc
      frac530&frac530&frac530&frac530&frac530&frac530 \
      frac4.8overline330&frac4.8overline330&frac4.8overline330
      &frac5.1overline630&frac5.1overline630&frac5.1overline630 \
      frac4.overline630&frac4.overline630&frac4.overline630
      &frac5.overline330&frac5.overline330&frac5.overline330 \
      frac4.530&frac4.530&frac4.530
      &frac5.530&frac5.530&frac5.530 \
      frac4.overline330&frac4.overline330&frac4.overline330
      &frac5.overline630&frac5.overline630&frac5.overline630 \
      frac4.1overline630&frac4.1overline630&frac4.1overline630
      &frac5.8overline330&frac5.8overline330&frac5.8overline330 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


    • $Pleft[X = xright] = 59251/36905625$.



Final Words



I know my answer was very long (& went far beyond what OP asked for) but this had been flying around inside my head for quite some time & this q seemed like the most suitable landing strip.



I performed the last 6 calculations using the function gmdPmf (which I defined in Mathematica)...



(* GENERALIZED MULTINOMIAL DISTRIBUTION (GMD) *)
(* Note: mXn = # rows X # columns. *)
gmdPmf[
x_ (* Responses of category j, after t trials have taken place. *),
p_ (* Matrix (tXm) holds p_trial i, category j = P["Response of trial i is category j"]. *)
] := Module[t, c, ⦋c⦌, allRPs, desiredRPs, count = 0, sum = 0, product = 1,
t = Total[x]; (* # trials. *)
c = Length[x]; (* # categories. *)
⦋c⦌ = Range[c]; (* Categories. *)
allRPs = Tuples[⦋c⦌,t]; (* Matrix (c^tXt) holds all the response patterns given that t trials have occurred. *)
desiredRPs = ; (* Matrix ((x_1,x_2,...,x_c) !Xt) holds the desired response patterns; subset of allRPs wrt n. *)

For[i = 1, i <= Length[allRPs], i++,
For[j = 1, j <= c, j++, If[Count[allRPs[[i]],⦋c⦌[[j]]] == x[[j]], count++];];
If[count == c, AppendTo[desiredRPs, allRPs[[i]]]];
count = 0;
];

For[i = 1, i <= Length[desiredRPs], i++,
For[j = 1, j <= t, j++, product *= (p[[j]][[desiredRPs[[i]][[j]]]]);];
sum += product;
product = 1;
];

sum
];

(* ANSWERS *)
Print["a1: P[X = x] = ", gmdPmf[0, 1, 12/30, 18/30], "."];
Print["a2: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 5/30, 5/30, 5/30, 5/30, 5/30, 5/30], "."];
Print["a3: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 4/30, 4/30, 4/30, 6/30, 6/30, 6/30], "."];
Print["a4: P[X = x] = ", gmdPmf[2, 5, ArrayFlatten[ConstantArray[12/30, 18/30, 7, 1]]], "."];
Print["a5: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, ArrayFlatten[ConstantArray[4/30, 4/30, 4/30, 6/30, 6/30, 6/30, 7, 1]]], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/2) - (1/2)*i)/30; r = ((29/2) + (1/2)*i)/30; AppendTo[p,l,r];]; Print["a6: P[X = x] = ", gmdPmf[2, 5, p], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/6) - (1/6)*i)/30; r = ((29/6) + (1/6)*i)/30; AppendTo[p,l,l,l,r,r,r];]; Print["a7: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, p], "."];

Clear[gmdPmf];


Please edit, if you know of any ways to make it shorter/faster. Congrats, if you made it to the end! (:






share|cite|improve this answer











$endgroup$



Preliminary (TL;DR)



Background



In his 1991 publication, Norman C. Beaulieu answered your question w/ what he dubbed, the generalized multinomial distribution (GMD). My explanation will focus on the GMD's utility.



Notation



  • # categories $= c$.

  • # trials $= t$.

  • Random vector $= X = left[beginarrayccccX_1&X_2&cdots&X_cendarrayright]^T$.

  • Category responses after $t$ trials vector $= x = left[beginarrayccccx_1&x_2&cdots&x_cendarrayright]^T$.


    • $sum_k = 1^c x_k = t$.


  • Probability of category response during trial matrix $= p = left[beginarraycccc p_1,1 & p_1,2 & cdots & p_1,c \
    p_2,1 & p_2,2 & cdots & p_2,c \
    vdots & vdots & ddots & vdots \
    p_t,1 & p_t,2 & cdots & p_t,c
    endarrayright]$
    .

  • Pmf of $X = Pleft[X = xright]$.


  • $[c] = left1, 2, cdots, cright$.


  • Multiset of $[c] = ([c], m) = left1^m(1), 2^m(2), cdots, c^m(c)right$.


    • $m(i) = x_i$.



  • Permutations of $([c], m) = mathfrakS_([c], m)$.


    • $cardleft(mathfrakS_([c], m)right) = left(m(1), m(2), cdots, m(c)right)!$.


Pmf of GMD



$$Pleft[X = xright] = sum_mathfraks in mathfrakS_([c], m) leftprod_k = 1^t leftp_k,mathfraks_krightright$$



So far, I've identified it as being the superclass of 7 distributions! Namely...



  • Bernoulli distribution.

  • Uniform distribution.

  • Categorical distribution.

  • Binomial distribution.

  • Multinomial distribution.

  • Poisson's binomial distribution.

  • Generalized multinomial distribution (if your definition of superclass allows self-inclusion).


Examples



Games



  • g1: A 2 sided die is simulated using a fair standard die by assigning faces w/ pips 1 through 3 & 4 through 6 to sides 1 & 2, respectively. The die is biased by etching micro holes into faces w/ pips 1 through 3 s.t. $p_1 = 12/30$ & $p_2 = 18/30$. The 2 sided die is tossed 1 time & the category responses are recorded.

  • g2: Same as g1, accept w/ ideal standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$.

  • g3: Same as g1, accept w/ standard die, i.e., $p_1 = p_2 = p_3 = 4/30$ & $p_4 = p_5 = p_6 = 6/30$.

  • g4: Same as g1, accept die is tossed 7 times.

  • g5: Same as g3, accept die is tossed 7 times.

  • g6: Same as g4, accept the micro holes are filled w/ $0.07$ kg of a material, which evaporates @ $0.01$ kg/s upon being sprayed w/ an activator, s.t. $p_1 = p_2 = 15/30$ for the 1st toss. Immediately after being sprayed, category responses are recorded every second.

  • g7: Same as g6, accept w/ standard die, i.e., $p_1 = p_2 = cdots = p_6 = 5/30$ for the 1st toss.

Questions



  • q1: Find pmf & evaluate when $x = left[beginarraycc0&1endarrayright]^T$.

  • q2: Find pmf & evaluate when $x = left[beginarraycccccc0&1&0&0&0&0endarrayright]^T$.

  • q3: q2.

  • q4: Find pmf & evaluate when $x = left[beginarraycc2&5endarrayright]^T$.

  • q5: Find pmf & evaluate when $x = left[beginarraycccccc0&2&1&1&0&3endarrayright]^T$.

  • q6: q4.

  • q7: q5.

Answers w/o knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^2 fracp_k^kk! = frac1!(12/30)^0(18/30)^10!1!$
      $Longrightarrow Pleft[X = xright] = 3/5$.


  • a2: $X$ ~ Uniform distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(5/30)^0 + 1 + 0 + 0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 1/6$.


  • a3: $X$ ~ Categorical distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 1!prod_k = 1^6 fracp_k^kk! = frac1!(4/30)^0 + 1 + 0(6/30)^0 + 0 + 00!1!0!0!0!0!$
      $Longrightarrow Pleft[X = xright] = 2/15$.


  • a4: $X$ ~ Binomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^2 fracp_k^kk! = frac7!(12/30)^2(18/30)^52!5!$
      $Longrightarrow Pleft[X = xright] = 20412/78125$.


  • a5: $X$ ~ Multinomial distribution.


    • $Pleft[X = xright] = t!prod_k = 1^c fracp_k^kk! = 7!prod_k = 1^6 fracp_k^kk! =
      frac7!(4/30)^0 + 2 + 1(6/30)^1 + 0 + 30!2!1!1!0!3!$

      $Longrightarrow Pleft[X = xright] = 224/140625$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $Pleft[left[beginarrayccX_1&X_2endarrayright]^T = left[beginarrayccx_1&x_2endarrayright]^Tright] = Pleft[X_1 = x_1, X_2 = x_2right] = Pleft[X_1 = x_1right] = Pleft[X_2 = x_2right]$.


    • $p_1$ & $p_2$ are vectors now: $p_1 = left[beginarrayccccp_1_1&p_1_2&cdots&p_1_tendarrayright]^T, p_2 = left[beginarrayccccp_2_1&p_2_2&cdots&p_2_tendarrayright]^T$.


    • $Pleft[X_2 = x_2right] = frac1t + 1sum_i = 0^t leftexpleft(frac-j2pi i x_2t + 1right) prod_k = 1^t leftp_2_kleft(expleft(fracj2pi it + 1right) - 1right) + 1rightright$
      $= frac18sum_i = 0^7 leftexpleft(frac-j5pi i4right) prod_k = 1^7 leftleft(frac0.5k + 14.530right)left(expleft(fracjpi i4right) - 1right) + 1rightright$
      $Longrightarrow Pleft[X_2 = 5right] = 308327/1440000$.


  • a7: $X$ ~ Generalized multinomial distribution.

    • ???


Answers w/ Knowledge of GMD



  • a1: $X$ ~ Bernoulli distribution.


    • $p = left[beginarraycfrac1230&frac1830endarrayright]$.


    • $mathfrakS_([2], m) = leftleft(2right)right$.


  • a2: $X$ ~ Uniform distribution.


    • $p = left[beginarraycfrac530&frac530&frac530&frac530&frac530&frac530endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a3: $X$ ~ Categorical distribution.


    • $p = left[beginarraycfrac430&frac430&frac430&frac630&frac630&frac630endarrayright]$.


    • $mathfrakS_([6], m) = leftleft(2right)right$.


  • a4: $X$ ~ Binomial distribution.


    • $p = left[beginarraycc
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a5: $X$ ~ Multinomial distribution.


    • $p = left[beginarraycccccc
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


  • a6: $X$ ~ Poisson's binomial distribution.


    • $p = left[beginarraycc
      frac1530&frac1530 \
      frac14.530&frac15.530 \
      frac1430&frac1630 \
      frac13.530&frac16.530 \
      frac1330&frac1730 \
      frac12.530&frac17.530 \
      frac1230&frac1830
      endarrayright]$
      .


    • $mathfrakS_([2], m) = leftleft(1,1,2,2,2,2,2right), ldots, left(2,2,2,2,2,1,1right)right$.


  • a7: $X$ ~ Generalized multinomial distribution.


    • $p = left[beginarraycccccc
      frac530&frac530&frac530&frac530&frac530&frac530 \
      frac4.8overline330&frac4.8overline330&frac4.8overline330
      &frac5.1overline630&frac5.1overline630&frac5.1overline630 \
      frac4.overline630&frac4.overline630&frac4.overline630
      &frac5.overline330&frac5.overline330&frac5.overline330 \
      frac4.530&frac4.530&frac4.530
      &frac5.530&frac5.530&frac5.530 \
      frac4.overline330&frac4.overline330&frac4.overline330
      &frac5.overline630&frac5.overline630&frac5.overline630 \
      frac4.1overline630&frac4.1overline630&frac4.1overline630
      &frac5.8overline330&frac5.8overline330&frac5.8overline330 \
      frac430&frac430&frac430&frac630&frac630&frac630
      endarrayright]$
      .


    • $mathfrakS_([6], m) = leftleft(2,2,3,4,6,6,6right), ldots, left(6,6,6,4,3,2,2right)right$.


    • $Pleft[X = xright] = 59251/36905625$.



Final Words



I know my answer was very long (& went far beyond what OP asked for) but this had been flying around inside my head for quite some time & this q seemed like the most suitable landing strip.



I performed the last 6 calculations using the function gmdPmf (which I defined in Mathematica)...



(* GENERALIZED MULTINOMIAL DISTRIBUTION (GMD) *)
(* Note: mXn = # rows X # columns. *)
gmdPmf[
x_ (* Responses of category j, after t trials have taken place. *),
p_ (* Matrix (tXm) holds p_trial i, category j = P["Response of trial i is category j"]. *)
] := Module[t, c, ⦋c⦌, allRPs, desiredRPs, count = 0, sum = 0, product = 1,
t = Total[x]; (* # trials. *)
c = Length[x]; (* # categories. *)
⦋c⦌ = Range[c]; (* Categories. *)
allRPs = Tuples[⦋c⦌,t]; (* Matrix (c^tXt) holds all the response patterns given that t trials have occurred. *)
desiredRPs = ; (* Matrix ((x_1,x_2,...,x_c) !Xt) holds the desired response patterns; subset of allRPs wrt n. *)

For[i = 1, i <= Length[allRPs], i++,
For[j = 1, j <= c, j++, If[Count[allRPs[[i]],⦋c⦌[[j]]] == x[[j]], count++];];
If[count == c, AppendTo[desiredRPs, allRPs[[i]]]];
count = 0;
];

For[i = 1, i <= Length[desiredRPs], i++,
For[j = 1, j <= t, j++, product *= (p[[j]][[desiredRPs[[i]][[j]]]]);];
sum += product;
product = 1;
];

sum
];

(* ANSWERS *)
Print["a1: P[X = x] = ", gmdPmf[0, 1, 12/30, 18/30], "."];
Print["a2: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 5/30, 5/30, 5/30, 5/30, 5/30, 5/30], "."];
Print["a3: P[X = x] = ", gmdPmf[0,1, 0, 0, 0, 0, 4/30, 4/30, 4/30, 6/30, 6/30, 6/30], "."];
Print["a4: P[X = x] = ", gmdPmf[2, 5, ArrayFlatten[ConstantArray[12/30, 18/30, 7, 1]]], "."];
Print["a5: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, ArrayFlatten[ConstantArray[4/30, 4/30, 4/30, 6/30, 6/30, 6/30, 7, 1]]], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/2) - (1/2)*i)/30; r = ((29/2) + (1/2)*i)/30; AppendTo[p,l,r];]; Print["a6: P[X = x] = ", gmdPmf[2, 5, p], "."];
p = ; For[i = 1, i <= 7, i++, l = ((31/6) - (1/6)*i)/30; r = ((29/6) + (1/6)*i)/30; AppendTo[p,l,l,l,r,r,r];]; Print["a7: P[X = x] = ", gmdPmf[0, 2, 1, 1, 0, 3, p], "."];

Clear[gmdPmf];


Please edit, if you know of any ways to make it shorter/faster. Congrats, if you made it to the end! (:







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Apr 2 at 23:43

























answered Mar 26 at 5:39









LandonLandon

123111




123111











  • $begingroup$
    I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
    $endgroup$
    – Landon
    Mar 26 at 5:40










  • $begingroup$
    Great. Thank you very much.
    $endgroup$
    – shahensha
    Mar 28 at 10:02
















  • $begingroup$
    I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
    $endgroup$
    – Landon
    Mar 26 at 5:40










  • $begingroup$
    Great. Thank you very much.
    $endgroup$
    – shahensha
    Mar 28 at 10:02















$begingroup$
I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
$endgroup$
– Landon
Mar 26 at 5:40




$begingroup$
I will add an example & a mathematica script when I have time. Let me know if you have questions, figure out a way to simplify it more, or make it more efficient to calculate by hand.
$endgroup$
– Landon
Mar 26 at 5:40












$begingroup$
Great. Thank you very much.
$endgroup$
– shahensha
Mar 28 at 10:02




$begingroup$
Great. Thank you very much.
$endgroup$
– shahensha
Mar 28 at 10:02











1












$begingroup$

I have come across very few resources on the topic. Such a problem is called Generalized Poisson's distribution or GPB. I am listing a few of them here to help others.



  1. An old paper describing the calculation of its approximate pdf.

  2. A 2018 paper describing an algorithm to compute its PDF using Fourier Transforms.

  3. An R package implementing the same.





share|cite|improve this answer









$endgroup$












  • $begingroup$
    This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
    $endgroup$
    – Landon
    Mar 23 at 22:12










  • $begingroup$
    Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
    $endgroup$
    – shahensha
    Mar 24 at 9:37











  • $begingroup$
    Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
    $endgroup$
    – Landon
    Mar 24 at 11:37










  • $begingroup$
    I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
    $endgroup$
    – Landon
    Mar 24 at 11:42










  • $begingroup$
    Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
    $endgroup$
    – Landon
    Mar 24 at 11:46















1












$begingroup$

I have come across very few resources on the topic. Such a problem is called Generalized Poisson's distribution or GPB. I am listing a few of them here to help others.



  1. An old paper describing the calculation of its approximate pdf.

  2. A 2018 paper describing an algorithm to compute its PDF using Fourier Transforms.

  3. An R package implementing the same.





share|cite|improve this answer









$endgroup$












  • $begingroup$
    This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
    $endgroup$
    – Landon
    Mar 23 at 22:12










  • $begingroup$
    Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
    $endgroup$
    – shahensha
    Mar 24 at 9:37











  • $begingroup$
    Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
    $endgroup$
    – Landon
    Mar 24 at 11:37










  • $begingroup$
    I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
    $endgroup$
    – Landon
    Mar 24 at 11:42










  • $begingroup$
    Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
    $endgroup$
    – Landon
    Mar 24 at 11:46













1












1








1





$begingroup$

I have come across very few resources on the topic. Such a problem is called Generalized Poisson's distribution or GPB. I am listing a few of them here to help others.



  1. An old paper describing the calculation of its approximate pdf.

  2. A 2018 paper describing an algorithm to compute its PDF using Fourier Transforms.

  3. An R package implementing the same.





share|cite|improve this answer









$endgroup$



I have come across very few resources on the topic. Such a problem is called Generalized Poisson's distribution or GPB. I am listing a few of them here to help others.



  1. An old paper describing the calculation of its approximate pdf.

  2. A 2018 paper describing an algorithm to compute its PDF using Fourier Transforms.

  3. An R package implementing the same.






share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Feb 9 at 13:36









shahenshashahensha

1285




1285











  • $begingroup$
    This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
    $endgroup$
    – Landon
    Mar 23 at 22:12










  • $begingroup$
    Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
    $endgroup$
    – shahensha
    Mar 24 at 9:37











  • $begingroup$
    Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
    $endgroup$
    – Landon
    Mar 24 at 11:37










  • $begingroup$
    I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
    $endgroup$
    – Landon
    Mar 24 at 11:42










  • $begingroup$
    Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
    $endgroup$
    – Landon
    Mar 24 at 11:46
















  • $begingroup$
    This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
    $endgroup$
    – Landon
    Mar 23 at 22:12










  • $begingroup$
    Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
    $endgroup$
    – shahensha
    Mar 24 at 9:37











  • $begingroup$
    Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
    $endgroup$
    – Landon
    Mar 24 at 11:37










  • $begingroup$
    I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
    $endgroup$
    – Landon
    Mar 24 at 11:42










  • $begingroup$
    Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
    $endgroup$
    – Landon
    Mar 24 at 11:46















$begingroup$
This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
$endgroup$
– Landon
Mar 23 at 22:12




$begingroup$
This is incorrect; the GPB refers to a generalization of the Poisson's binomial distribution where the binary indicator functions w/ support 0,1 are replaced w/ a weighted indicator function w/ support a, b where a & b can be any number.
$endgroup$
– Landon
Mar 23 at 22:12












$begingroup$
Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
$endgroup$
– shahensha
Mar 24 at 9:37





$begingroup$
Thank you so much for pointing it out @Landon I will delete the answer? But before I do so, can you give any pointers in the direction of answering the original question?
$endgroup$
– shahensha
Mar 24 at 9:37













$begingroup$
Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
$endgroup$
– Landon
Mar 24 at 11:37




$begingroup$
Don't delete the answer; people who make the same mistake might be corrected by it. I searched for & read through every paper I could find containing the keywords "poisson multinomial distribution"/"poisson's multinomial distribution" & found 0 closed form expressions. Surprisingly, computer scientists, rather than statisticians, seem to be more obsessed w/ it, i.e., I found only algorithmic solutions.
$endgroup$
– Landon
Mar 24 at 11:37












$begingroup$
I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
$endgroup$
– Landon
Mar 24 at 11:42




$begingroup$
I am surprised not more people are interested in this concept; it would be a multitool of a closed form expression, being able to solve 4 types of distributions; namely, itself, poisson binomial, multinomial, & binomial distributions. Very desirable, indeed.
$endgroup$
– Landon
Mar 24 at 11:42












$begingroup$
Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
$endgroup$
– Landon
Mar 24 at 11:46




$begingroup$
Also, if it helps, I did find/confirm that the "compound binomial" can be used to solve the poisson binomial but I found no closed form expressions searching for "compound multinomial"; infact, it seems that many people define compound binomial to mean different things.
$endgroup$
– Landon
Mar 24 at 11:46

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • 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.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2164222%2fgeneralizing-poissons-binomial-distribution-to-the-multinomial-case%23new-answer', 'question_page');

);

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







Popular posts from this blog

Moe incest case Sentencing See also References Navigation menu"'Australian Josef Fritzl' fathered four children by daughter""Small town recoils in horror at 'Australian Fritzl' incest case""Victorian rape allegations echo Fritzl case - Just In (Australian Broadcasting Corporation)""Incest father jailed for 22 years""'Australian Fritzl' sentenced to 22 years in prison for abusing daughter for three decades""RSJ v The Queen"

Who is our nearest planetary neighbor, on average?Santa Claus flies to the South PoleSeven Spheres of Unequal Mass, a weighing problem with a twistDescribe a large integerFast Mental Calculation of $7.5^7$Math in Space (without the help of celebrities)Find the value of $bigstar$: Puzzle 8 - InequalityWho drinks beer while running anyway?A Crucial DeliveryRanking And AverageHow long will my money last at roulette?

Daza language Contents Vocabulary Phonology References External links Navigation menudaza1242Daza"Dazaga"eeee178086576