Bayes
Binomial Distribution
Probability distribution, estimating the probability of a certain number of binomial outcomes (yes/no, true/false,etc) occuring, when you know the probability of a single event occuring.
You describe a binomial distribution with:
- \(B\): Binomial Distribution
- \(n\): number of trials
- \(p\): probability of an individual success
- \(k\): amount of total successes seen
So this is saying whats the probability of seeing exactly \(k\) successes, when you tried \(n\) times, and you know the probability of an individual success is \(p\)
The way \(k\) is calculated is through the Binomial Coefficient.
\(\binom{n}{k}\)
This is stating, how many different combinations of outcomes could there be, when you try \(n\) amount of times, and how many of those would get us exactly \(k\) positive outcomes.
How do you calculate the Binomial Coefficient?
- \(n!\): Factorial of \(n\), e.g if n = 5, n! = 5x4x3x2x1
So to calculate \(B(k;n,p)\), it's:
You could rewrite this for the estimate of \(P\) with:
So then you can describe \(B(k;n,p)\)'s probability mass function as:
When you run dbinom(k,n,p) in R,
you are calculating the probability mass function,
for a specific value for k,n, and p.
So the probability mass function isn't the whole probability distribution, it's just a snapshot.
If you want the full distribution of probability of certain outcomes, from \(k=0\) to \(k=n\), you'd need to work this out for each value of \(k\).
plot(function(p) dbinom(p,100,0.5),0,100)
You might want to work out the probability of \(k\) bein at least a certain value, in R you would use:
pbinom(0,100,0.5,lower.tail=F)
This is saying what's the probability of any value of \(k\) greater than 0 (specified by the lower.tail=F it), in 100 trials, where p = 0.5
Beta Distributions
Beta Distributions could be seen as the mirror to the binomial distribution in some ways. In a binomial distribution you have a value for the probability of an individual event occuring, and you want to estimate how probable it is you'll see a certain number of outcomes. In a beta distribution you have a value for how many events you observed out of how many attempts, and you want to estimate the probability of an individual event occuring.
- \(\alpha\): Amount of Events
- \(\beta\): Amount of Attempts - Amount of Events
| Flashcard | type:basic |
|---|---|