(English (Auto-Generated) ) 38 - The Poisson Distribution - An Introduction - 2 (DownSub - Com)

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 11

in this video i want to continue our

introduction to the possum distribution

so in this video we're going to go ahead

and derive

the mean of a poisson distribution we're

going to state it's variance as well and

we're going to see

how the selection of the parameter

lambda actually determines the shape of

the possum distribution

via a matlab simulation we're also going

to talk about the circumstances

under which we can use a poisson

distribution to approximate a binomial

distribution and

again we're going to compare the two

using a matlab simulation which

you can run for yourself we're going to

finish off by

quickly discussing the conjugate prior

to a processing distribution

which is to assume that lambda is

actually gamma distributed

so first of all how do we derive the

mean of

a poisson distribution so what we're

looking for is the expected value of

y well seeing as the poisson

distribution is a discrete distribution

we get this just by summing over all the


values of y

so y is it takes on the value 0 1 2 3

up to positive infinity where y is

taking on the sort of positive integers

and we're summing over y times the

probability density so that's just times

this thing up here so y

times lambda to the power y times e to

the power

minus lambda all divided through by

y factorial and firstly we can just take

the e to the power minus lambda out the

sort of summation here because it

doesn't contain any y

so this is just e to the power minus

lambda then if we look at the

corresponding terms the first term here

is going to be when y is zero so that's

not going to contribute anything because

we're going to have zero times

something which is positive which is

zero so then if we think about the

circumstance

where y is equal to one this whole

numerator then

is just going to give lambda and we're

going to be dividing through

by 1 factorial and one factorial is just

one so then we just get


lambda so then if we think about the

circumstance when y is equal to 2

we're just going to get a lambda squared

and

on the top here we've got 2 times lambda

squared divided 3 by 2 factorial well 2

factorial

is just 2 so the 2s cancel and we're

just left with lambda squared

and then what we get for lambda cubed is

we get

essentially three times lambda cubed

divided through

by three factorial which is just well

the threes are going to cancel on the

top and the bottom

and we're just going to be left with two

factorial and we could continue up

for lambda to the power four and by the

same reasoning we get lambda to power

four divided three by three factorial

and we could continue in on uh forever

then what we do is we notice that there

is a common factor of lambda in all of

this so we can then take

lambda outside of this so then we get

lambda times e to the power minus lambda

and then what we get here is just 1 plus

lambda

plus lambda squared over 2 factorial


plus lambda cubed over three factorial

continuing on forever and then we notice

that this thing inside the parenthesis

here

is again our taylor series series

expansion of e to the power lambda

so then we just get lambda times e to

the power minus lambda

times e to the power lambda and hence

the minus lambda and the lambda cancel

with one another

and we're left with this process just

having a mean of lambda

so that now proves that lambda is the

sort of rate

of or the mean rate of occurrence of

events which we're counting

how about its variance well you can go

about proving this in exactly the same

way

and it turns out that the variance of

the count

is also lambda so the poisson

distribution

is only appropriate in circumstances

where the mean

and the variance are very similar if

the variance is greater than mean so

we've got a sort of over dispersed data


then it might be more adequate to use

something which we're going to call

here a negative binomial distribution

and we're going to discuss that

distribution in the future but just so

you sort of heard about it

in circumstances when the variance is

greater than the mean we might want to

use the negative binomial distribution

then what we can do is we can actually

draw what this probability mass function

actually looks like and remember that

we're talking about discrete values of y

here and what we're going to be sort of

plotting

is the corresponding value of the

probability mass function which is given

by this function up here

as we change y and we expect to see

something which goes up

and sort of peaks and then sort of comes

down

as we're sort of increasing y and note

that essentially what's happening here

is we don't have a continuum of

values here as we would with a

continuous probability distribution

we've only got discrete values which

correspond to the particular values of y

and we expect that the mean of this


distribution

should have a mean which is close to the

value of lambda that we choose

and its variance is also close to the

value of lambda which we choose

so i've created a matlab simulation here

which actually creates a poisson

distribution and i

actually graphically displays the

probability mass function

so what we're starting out with is we're

starting out with assuming

that lambda here is equal to 10. and

what i'm actually going to be doing is

i'm going to go through and i'm going to

calculate the mean

and the variance which this distribution

implies

when we take the first sort of 100

positive integers

so if we graph this we expect that it's

going to be peaked

somewhere near 10 it's not going to be

exactly 10 because

10 remember is the mean not the mode

but if we draw this then we can see here

that for the probability mass function

the peak actually corresponds pretty

closely to 10.
and remember that this is a discrete

distribution so really what we should

only be looking at are the sort of blue

crosses here or the blue blobs

which correspond to the sort of height

of the probability mass function

at those integer values of the sort of

count of events

so here we see that we've got a

theoretical mean

which should be 10 and the theoretical

variance which should also be 10 and

that actually corresponds very closely

to the actual mean

and variance which we've calculated

using this distribution

we could then see if we were to decrease

the value of lambda let's say 5

we should expect that this distribution

now shifts over to be peaked

somewhere near to five so if we rerun

that

we see exactly this so again the

distribution has kind of shifted

such that its main support is now around

five

i now want to talk about the

circumstances under which it is

appropriate to approximate a binomial

distribution
via a poisson distribution so we're

going to assume that x

is binomially distributed with

a sort of total number of cases being n

and the probability of set success here

just being p

and we know for the case of when x

represents the count

of successful events occurring that the

binomial distribution says that the

probability that

x is equal to a particular sort of count

value k

is actually equal to if we sort of write

it below

it's n sort of k where this notation

really means

ncr and then it's just simply

p to the power k times 1 minus p

to the power n minus k and the sort of

problem with the binomial distribution

is that when we actually have sort of

large values of n

relatively large values of k this sort

of term here can be difficult

to actually calculate especially by hand

and it actually turns out that we can

use the poisson distribution

in many circumstances to approximate a


binomial distribution if

certain criteria are satisfied and those

criteria

are that n is itself quite a large

number

say the number sort of total number of

trials is a large number

and that the probability of success is

itself

a very small number in those

circumstances

we can actually approximate x here by

a poisson distribution which has got a

value of lambda

which is actually equal to n times p

and i'm not going to provide a proof of

this as the proof is actually quite

involved

but what i want to do is i want to

actually graphically show

that the possible distribution does

actually provide

a very adequate approximation to the

binomial distribution

when these two criteria are satisfied so

what i've done here is

i've actually coded up a matlab script

and

the circumstance which is talking about

here is when we're talking about a total


number of

trials being 100 and the sort of

probability of its success

in any given trial we are assuming to be

0.1

and then what i go through and do is i

calculate the

binomial distribution and which is the

sort of true

value or the true probabilities and then

i approximate that using a possible

distribution

which has got a value of lambda which is

equal to n times p which is just what

i've sort of stated here in the text

so if we run this then we can see here

for the circumstance of when

n is 100 and p is 0.1 the plus on

approximation

to the binomial sort of exact

probabilities

is pretty good and this approximation

becomes even better

if we decrease the value of p so if i

decrease p

by a factor of 2 to 0.5 and then i rerun

this

then we actually see that the possible

approximation is that much closer to the


binomial approximation

and if we decrease the value of p

further to let's say 0.01

and let's say i increase n up to a

thousand

so this is now going to have a sort of

value of lambda which is 10.

if we now rerun this we see here that

the

binomial tree values are very very well

approximated by the poisson

approximation here

finally i want to finish by just stating

the conjugate prior

for a poisson distribution and it turns

out and we're going to prove this in

later videos

that assuming a prior on lambda which is

lambda is what we call gamma distributed

with parameters alpha and beta

is actually a conjugate prior to

the poisson distribution so in those

circumstances

that we have a gamma prior on lambda and

we have a poisson likelihood

the posterior distribution will itself

be a

gamma distribution

You might also like