Simulation of beta-binomial distribution

In summary, the conversation discusses different types of distributions that can be used to calculate the number of successes in a sequence of experiments with varying probabilities of success. These include the well-known binomial distribution, the Poisson's binomial distribution, and the beta-binomial distribution. The participants also discuss the use of a probability generating function to calculate the distribution when each event has a different probability of success.
  • #1
fchopin
10
0
Hi all!

I'm trying to solve the following problem.

The number of successes in a sequence of N yes/no experiments (i.e., N Bernoulli trials), each of which yields success with probability p, is given by the well-known binomial distribution. This is true if the success probability p is constant and the same for all the N trials.

However, when the probability of success, p, is different for each trial, p_1, p_2, ..., p_N, then the number of successes does not follow a binomial distribution, but a Poisson's binomial distribution instead:

wikipedia--> /Poisson_binomial_distribution

I understand that the Poisson's binomial distribution is valid for any set of probabilities p_1, p_2, ..., p_N.

In my problem, I know that the probabilities p_1, p_2, ..., p_N follow a beta distribution. I found out that, in such a case, the resulting PMF of the number of successes in N trials is given by the beta-binomial distribution:

wikipedia --> /Beta-binomial_distribution

However, I have been playing a bit with some simulation and it seems that this distribution does not fit the resulting PMF. I'm attaching a Matlab file that makes some simulation and generates the PMFs.

What am I doing wrong? Is it possible to exploit the knowledge that the p_1, p_2, ..., p_N follow a beta distribution to simply the general Poison's binomial case? What is the PMF that I need?

Many thanks in advance!

Fryderyk C.
 

Attachments

  • question.m
    3 KB · Views: 419
Physics news on Phys.org
  • #2
I don't know matlab. Did you draw a new value of p on each bernoulli trial? You comment says you intended to, but I don't see where this happened inside your loop on t.
 
  • #3
Thanks for quick reply.

Basically my problem is that I have a set of N "things" I observe at different time instants t, and I know the success/failure probabilities for each "thing". What I need is the probability to observe k successes in each observation of the N "things".

So I first generate a vector p with N beta-distributed random numbers --> p = betarnd(a,b,1,N), which remains always the same.

Then I use the same set of probabilities p = p_1, p_2,...,p_N in every iteration of the loop on t.

In the problem I'm studying, the N values of p are known and constant. I thought this might be the reason why the beta-binomial distribution doesn't fit. However, I tried drawing different values of p in every iteration of the loop on t and the result doesn't fit the beta-binomial distribution either. In this case, even the Poisson's binomial distribution doesn't fit! Any ideas? Thanks!
 
  • #4
fchopin said:
Thanks for quick reply.

Basically my problem is that I have a set of N "things" I observe at different time instants t, and I know the success/failure probabilities for each "thing". What I need is the probability to observe k successes in each observation of the N "things".

So I first generate a vector p with N beta-distributed random numbers --> p = betarnd(a,b,1,N), which remains always the same.

Then I use the same set of probabilities p = p_1, p_2,...,p_N in every iteration of the loop on t.

In the problem I'm studying, the N values of p are known and constant. I thought this might be the reason why the beta-binomial distribution doesn't fit. However, I tried drawing different values of p in every iteration of the loop on t and the result doesn't fit the beta-binomial distribution either. In this case, even the Poisson's binomial distribution doesn't fit! Any ideas? Thanks!

If you have independent events for each 'thing' but the probabilities for each thing is different, then you can use what is called a probability generating function to generate the distribution even if each thing has a different probability.

http://en.wikipedia.org/wiki/Probability-generating_function
 
  • #5
fchopin said:
Thanks for quick reply.

Basically my problem is that I have a set of N "things" I observe at different time instants t, and I know the success/failure probabilities for each "thing". What I need is the probability to observe k successes in each observation of the N "things".

So I first generate a vector p with N beta-distributed random numbers --> p = betarnd(a,b,1,N), which remains always the same.

Then I use the same set of probabilities p = p_1, p_2,...,p_N in every iteration of the loop on t.

In the problem I'm studying, the N values of p are known and constant. I thought this might be the reason why the beta-binomial distribution doesn't fit. However, I tried drawing different values of p in every iteration of the loop on t and the result doesn't fit the beta-binomial distribution either. In this case, even the Poisson's binomial distribution doesn't fit! Any ideas? Thanks!

I don't think your description fits the Beta-Binomial distribution but rather the Poisson-Binomial distribution, the moment you know the probability of success of your event within a period t it is irrelevant if you know it because X follows a Beta distribution or any other, the fact is that you know it.
 
Last edited:

Related to Simulation of beta-binomial distribution

1. What is the beta-binomial distribution?

The beta-binomial distribution is a statistical distribution that describes the probability of a certain number of successes in a fixed number of trials, where the probability of success varies from trial to trial. It is a generalization of the binomial distribution, where the probability of success is constant in each trial.

2. How is the beta-binomial distribution different from the binomial distribution?

The main difference between the beta-binomial and binomial distribution is that the probability of success in the beta-binomial distribution is not constant, but instead follows a beta distribution. This allows for a more flexible modeling of data with varying probabilities of success.

3. What are some real-life applications of the beta-binomial distribution?

The beta-binomial distribution is commonly used in biology and genetics to model the number of successful mutations in a DNA sequence. It is also used in quality control and reliability analysis to model the number of defective products in a batch. Additionally, it has applications in finance and economics, such as modeling the number of successful trades or the number of bankruptcies in a given time period.

4. How is the beta-binomial distribution simulated?

The beta-binomial distribution can be simulated using a variety of methods, such as the inverse CDF method or the Monte Carlo method. In the inverse CDF method, random numbers are generated from a beta distribution and used to calculate the probabilities of success in each trial. In the Monte Carlo method, a large number of simulations are run and the results are averaged to estimate the probabilities of success.

5. What are the advantages and limitations of using the beta-binomial distribution?

The beta-binomial distribution offers more flexibility in modeling data with varying probabilities of success compared to the binomial distribution. It also allows for the incorporation of prior knowledge or beliefs about the probability of success. However, it may not be suitable for data with a large number of trials, as it can become computationally intensive. Additionally, it assumes independence between trials, which may not always be the case in real-life scenarios.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
935
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
14
Views
6K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
1K
Back
Top