Lecture 21 : Random Variables: Probability Functions

IIT Kanpur July 201
20 followers
Jun 5, 2024
[Music]
Hello friends welcome to the course
multivariate procedure with r so you can
recall that in the last lecture we had
uh discussed the concept of random
variables so we had discussed that there
are two types of random VAR able
discrete and continuous and uh the
random variables can be one more than
one also so based on that we had a
concept of univariate random variable
bivariate random variable as well as
multivariate random variable my idea was
only to make you familiar and
comfortable with the concept of random
variables so that whenever um I am going
to use this
word it looks a comfortable and known
familiar word
now I come to another Topic in case if
you try to see what this random variable
is going to do this random variable is
going to
represent the data generating
process because you are trying to
observe the data on random variable for
example if I say height then you are
trying to get some observation on height
of the students and if I say this x is
temperature random variable is
temperature then you are going to
collect the data on temperature and
these values have some random
variation so if you try to see the way
data is being generated either on say
temperature or any other random variable
there is always a process behind the
random
variable and the data is is generated
according to that process definitely in
this word there are so many types of in
uh experiments they can be con conducted
or there are so many process which are
going on in the nature and the way they
are occurring they are entirely
different the way it rains it is
entirely different the way it the way
the
sunshines the way the he of a crop is
produced it is very different than the
way some machines are produced in a
factory so every process may have one or
more than one random variable depending
on your nature
but behind them there is a
process so now the question
is how to get an idea about that
process and uh we have now understood
that unless and until we try to express
anything without using the mathematics
people are not going to believe on
us so that is why now it is very
important that if I try to define a
random
variable then associated with it there
is a
process suppose if I take an example of
Health suppose X indicates height then
height will have a different process by
which it works for example Heights of a
human
being the increas is right from the
birth till certain age say age of 21
22 but after that means either they
become stabilized or the growth is very
little
but the blood pressure blood pressure of
the same human being will have a
different
process that how it
varies so now my question to you is that
depending on the choice of random
variable how are you going to
mathematically mathematically present
this
process now it depends whether your
random variable is continuous discrete
univariate bivariate multivariate and
based on that we need to have a
mathematical function which can Define
the
process based on that we have a concept
of probability density function
probability Mass functions and based on
that we have different types of uh
Concepts in the context of univariate
random variable B variate random
variable and uh yeah all these Concepts
actually in statistics they are t
um in detail but here I am not going to
explain this concept in that much detail
but my idea is to give you some
information a reasonable knowledge so
that it is not difficult for you to
understand the topics of the
multivariate procedure that we are going
to discuss later on so these topics
random variable there density function
Etc they are going to help when we are
going to discuss the multi vate
procedure that is why I'm trying to
create a foundation in the beginning and
once again I would say I am covering
here only limited number of topics which
are required to understand the topics
which I am planning to cover in the
forthcoming lectures only if you want to
have more information on these topics my
advice to you all is that please try to
look into the books on statistics
probability Theory mathematical
statistics Etc and you will get uh solid
foundation and solid Knowledge from
those books so in this lecture let us
try to discuss about different types of
probability functions and we try to
understand them quickly so let us begin
our lecture now okay so now in this um
lecture we are going to talk about the
different types of probability functions
right so first I try to define the
concept of probability density function
which is shortly Express as PDF P here
is for probability D here for density F
here is for function function now this
probability function for a continuous
random variable and for a discrete
random variable they are different mean
they are trying to represent a similar
concept but mathematically they are
expressed in a in in different ways in
the case of continuous random variable
this is called as probability density
function PDF and in the case of uh see
here discrete random variable this is
called here as a
probability
Mass
function or see here
[Music]
pmf that's a popular name so now let me
try to give you the idea of this PDF and
pmf one by one so now I am going to
consider first the case of continuous
random variable and in the in this case
we have a probability density function
as the name suggest probability density
function or probability
functions that means how the
probability of the values of of random
variables are going to behave for
example if you recall in the last
lecture we had taken an example of a
coin Crossing where the outcomes were
head or tail and their probabilities
were 1 by two and 1 by two right so with
the values of the random variable there
is always an Associated probability and
these probability functions are going to
explain as the behavior of the
probability as the values of the random
variable change so in the case of
continuous a random variable we try to
define a probability density function by
a mathematical function so so for a
function FX if it is to be a probability
density function of a continuous random
variable X it needs to satisfy the
following two conditions f of x should
be greater than zero for all values of X
that means at every value of this random
variable this value FX has to be greater
than or equal to zero and the integral
over the whole range of X should be
equal to 1 so here I'm trying to write
the integral of minus infinity to plus
infinity FX DX is equal to 1 so I'm
assuming that my random variable is
taking value between minus infinity and
plus infinity but in case if x is trying
to take the values between here a and
here B greater than a and less than b
then this integral will become here A A
to B right so these are the two
condition which have to be satisfied but
before we try to go into the
mathematical aspect let me try to give
you here an idea that how are you going
to understand this function because in
practice if you try to see uh nobody's
going to come and explain you that okay
in this uh
case uh this is going to follow the
normal probability density function in
this case it is going to follow a gamma
density function etc etc this is only
you who has to look at the data and you
have to take a call and decision that
that which probability function is to be
used in this case so that you can draw
the correct statistical inference and if
you try to change the probability
density function the way you are trying
to draw the statistical inference will
also change so now in practice how are
you going to get a fair idea about the
probability density function right okay
couple of lectures back if you recall
that we had discussed the uh the
histogram and in histogram what do we do
that we have a data set and we try to
classify them into different intervals
and the frequency the absolute frequency
or the relative frequency in those
interval is plotted on the graph and
which gives us the histogram so if you
try to look here for example if I try to
see here in this if you try to look here
in this histogram suppose if I take here
this is here your X and here it is FX
right so if you try to create this
histogram and if you try to take here
the midpoint of each of the bar of the
histogram like this here and if you try
to join these points by a smooth curve
means you start drawing the curve by
putting a pen on the paper and draw it
without lifting your pen so if I try to
and then try to join this midpoint so if
I try to gradually draw it it will look
something like this
here you can see here like this and this
curve can be viewed that if the width of
these bins or this bars is
reduced then you can imagine that as the
width of the bar is converging towards
zero it it is tending toward
zero then what will happen all these
midpoints will start look like here
these dots and you are simply trying to
join this actually this Dots here and
this is what I have represented here in
this line you can see so this is
actually a probability
curve and this curve is being indicated
by
the
probability density
function when we are trying to handle a
real set of data right so this is I'm
trying to explain you that how are you
going to look at this
probability density function from a data
and then by this curve you can have a
fair idea okay this curve resemble with
the probability density curve of this
particular distribution so I can start
working with that distribution and if
you try to see there is a on to one
correspondence between the relative
frequency and the probability so if you
try to see in a particular say this
interval there is some frequency
quy and what we are trying to plot here
this is essentially here the relative
frequency so relative frequency is the
total number of points which are lying
in this bin or in this inside this bar
or the total number of points which are
lying in this interval divided by the
total number of observations and if you
try to see or if you try to recall the
definition of probability which you
studied in your Elementary classes it
was the total number of favorable Point
divided by the total number of points
right so that is why this midpoints or
these
Heights they are going to indicate the
relative frequency which in turn is
indicating the probability of the event
right so this is how we in practice we
try to approximate the probability
density function from a
histogram right so as I said the
relative frequency is an estimate of the
probability that a measurement Falls in
in the interval for example if this is
here like this this is here the relative
frequency then this an estimate of the
probability and we know what is the
total sum of relative frequency this is
always one so that is why the total area
under this here
curve this will always be equal to one
and so in case if you want to estimate
the probability of an
event what you have to do you have to
Simply find out the area of the curve
which is lying under that interval
suppose if I want to find out what is
the probability of an even falling in
this range A to B so basically I have
to calculate this area of these three
bars so this is one to one uh means
relation between uh the probability
Theory and the relative frequency and
this I'm trying to explain you because
whenever you are trying to work with the
multivariate procedures so usually there
will be more than one variable and uh
yeah then you will have to get some idea
that what is the probability dist uh
distribution of this random variable and
based on that your this computations are
going to depend upon right so that is
why by plotting such a data you can have
a fair idea right after this concept of
probability density function we have a
concept of cumulative distribution
function which is indicated by here
CDF C for cumulative D for distribution
and F for function right so this
actually here the ass sort of total
probability up to certain point right so
this CDF or cumulative distribution
function or it is popularly called as
only distribution function it is
indicated by capital
F so this capital F or the CDF of a
random variable X is defined for any
real number is small X as the
probability that capital x is less than
equal to X right so you can see here
suppose if I try to show you here in
this curve also suppose if I try to
clear this screen and if I try to show
you you here that probability up to this
particular point this is here the this
area suppose it is my here Point number
a so I can see here this is the
probability that X less than equal to a
so this will indicate the value of CDF
at Point a right and I can write it down
here like this and similarly if I try to
take here the area up to here this
particular Point suppose this point here
is my here B so if I want to cover this
area then this is going to be nothing
but probability that X is less than
equal to B and this is going to be the
value of the CDF of random variable X at
point B so this is exactly the same
concept which is being explained here
probability that X is less than equal to
small X and this is indicated by here f
of x right sometime more specifically we
write in down here F subscript capital X
and the value inside the parenthesis is
small X right so this Capital FX is the
probability that a random variable X
takes on a value that is less than or
equal to small X so this is the concept
of
CDF all right so in case if you want to
find out the CDF for a continuous random
variable then how to get it done you can
know you know that in for example in
this case if you want to find out such
areas these areas can be obtained by the
integration right and based on that we
also have a definition that when do we
say that our random variable is discrete
or continuous so we say that a random
variable X is continuous if there is a
function small FX such that for all X
belonging to the real number r capital
FX is defined here as say minus infinity
to small X
ftdt right so basically your here F here
is the PDF in the case of continuous
random variable so you are simply trying
to inte from minus infinity to a
particular point and then it will give
you here the value of the probability up
to the point is small X and this is
simply your here CDF so FX is here the
CDF of X and small f is the probability
density function of X and in case if you
are if you know the CDF then you can uh
differentiate it at at a small X or say
differentiate it with with respect to X
and then you will get here the value of
PDF and this can be obtained for all X
that are the continuity points of X so
this is the mathematical part I just
wanted to give you some idea so that you
understand that there is always a
mathematical concept which is associated
with the concept which I'm trying to
explain based on the data right and now
this PDF and
CDF uh they can be used in different
ways for example whenever you are trying
to conduct any statical analysis you are
interested in finding out different
types of probabilities so if you know
the PDF then also you can find out
different probabilities if you know the
CDF then also you can find different
types of probabilities so just for the
sake of your convenience I try I'm
trying to give you here one result that
if a random variable X has a CD of
capital x and suppose if there are two
points small X1 and a small X2 such that
X1 is less than X2 there are some known
values known constant and if you want to
find out the probability that capital x
random variable lies between small X1
and a small X2 two values then this can
be obtained here as a difference of the
CDF at X2 and X1 that is f of X2 minus F
of X1 right and uh this can be expressed
as a integral say small X1 to small X2
FX
DX right and definitely one very
important result for you to understand
that in the case of a continuous random
variable the probability at particular
point is
zero right this can be obtained here
like this probability of xal to x0 that
is the integral x0 to x0 FX DX which is
equal to 0 right now in practice you
will always be confused that how to get
the observation on the continuous random
variable so you will see in practice we
are always getting the observation which
are discrete but it depends on the
nature of the variable that decide to
take it as continuous or not right and
uh now let me try to give you one simp
simple example to explain you the uh
utility of this probability density
function so for example there is some
continuous random variable X and whose
probability density function is given by
here like this FX is equal to
exponential of minus x if x is greater
than or equal to Z and zero otherwise
and suppose if you want to find out the
probability that capital x lies between
small a and small B two numbers then
this can be obtained here as a integral
A to B FX DX and if you try to plot it
then you will see here this curve of
exponential of Min - x is here like this
you can see here and if you want to find
out here that X is lying between A and B
suppose this is here point a and this is
here point B so this is the Shaded area
which is going to give you this integral
or this probability right now let me try
to give one more example so that I can
show you that how these probability
functions are formulated and how they
are used well I'm trying to take a very
simple example so that you can
understand them in practice the examples
are not usually going to be so simple
suppose uh I want to do some analysis
about the waiting time for the train
that uh different persons arrive at the
Metro railway station and suppose the
Metro Railways or the Metro trains which
are frequently uh going and I want to
know that how much time a person has to
wait before uh the train arrives right
so suppose my random variable is the
waiting time for the train and suppose
that train arrives after every 20
minutes so what will happen if a person
arrives in the at the station the person
has to wait between 0 and 20 minutes if
the train is already there on the
platform the person can catch it
immediately and the waiting time will be
zero but suppose the person arrives at
the platform and when the train is just
leaving then the person has to wait for
20 minutes right so this waiting time of
a particular person is a random value or
a random variable which is trying to
take the value or any value which are
contained in the interval 0 to
20 so suppose I can say here that we can
think that okay there can be a
mathematical function
FX which can take a value here k
if uh X is lying between 0 and 20 and
zero otherwise and this F we can through
this effect we can design the
probability density function and K is
some unknown constant another question
is this if you if the K is unknown how
are you going to use it so now we try to
utilize the properties of probability
density function and we try to to find
the value of K so that in turn we can
have a probability density function
which can be used for further
application so we know uh from the
probability of from the property of
probability density function that the
integration over the whole range of X
should be equal to one so I Tred to make
it here integral 0 to 20 FX DX should be
equal to 1 and if you try to solve it
this will come out to be 20K this
implies that K is equal to 1 upon 20 so
now my PDF is given by here like this FX
is equal to 1 upon 20 for X lying
between 0 and 20 and zero
otherwise right so now you have got here
this a PDF and now you can use it for
different job for computing different
types of uh probabilities right now
before I try to move forward let me try
to also give you an idea here how are
you going to find out the CDF from a
given PDF so if you try to see here the
CDF FX is defined as 0 tox ftdt and so
now here it is Ft here is one 1 upon 20
DT and and if you try to solve it this
is coming out to be coming out to be
here x upon 20 so now suppose we are
interested in calculating the
probability of a waiting time between 15
and 20 minutes so now that means X is
lying between 15 and 20 which can be
written here say F20 minus F15 and now
using this value I can write down here
directly 20 upon 20- 15 upon 20 which is
0.25 so that means if a person arrives
at the railway station then there are
25% chances that the person will have to
wait between 15 and 20 minutes right so
now after this continuous random
variable let me try to give you some
idea about the probability Mass function
also the probability Mass function is
defined for a discrete random variable
right so we know that the probability
distribution of a random variable X is a
description of the probabilities
associated with the possible values of
X the difference between continuous and
discrete random variable is that the
continuous random variable is trying to
take the value in an interval whereas
the discrete random variable takes the
value at points so that is why for a
discrete random variable the
distribution of probability is a
specified by a list of the possible
values and in certain cases it is easier
for us to find out a mathematical
formula which can describe different
probabilities that one can compute
different types of probabilities and in
some cases we try to Define it only by
giving the value of the random variable
and the corresponding probability
right so uh Suppose there is a discrete
random variable X which takes K
different values now in this case the
probability function is called as
probability Mass function or say p MF so
p is coming from probability M from Mass
and F from function so the probability
Mass function of X is given by here
probability that X takes the value x i
which is equal to suppose here Pi I for
each I to 1K so for X = to X1 the
probability is P1 for X = to X2 the
probability is P2 and so on so in this
case also similar to the two conditions
in the case of probability density
function similar conditions are here for
the probability Mass functions also so
we assume that each value of the pi is
between 0 and one and the sum over the
whole sample space of this Pi is equal
to one right so these are the two
condition for a function to become a
probability Mass function and similarly
in the case of a discrete random
variable also we can Define the
cumulative distribution function like
this FX will be equal to summ I goes
from 1 to K say Pi I right and it is
here an indicat function means we will
take the value one if x i is less than
equal to X and zero otherwise so the
difference between the CDF of discrete
and continuous random variable is that
in the case of discret random variable
the CDF is always a step function like
this one this this this like this
whereas in the case of continuous random
variable this will always be a
continuous increasing curve like this
thing right and then yeah mean I'm not
giving you here different properties of
the CDF um because that I'm not going to
consider in the further lectures so but
uh my strong recommendation to you all
is that please try to look into the book
and try to at least read the basic
concept of PDF pmf and the cumulative
distribution function for discrete and
continuous random variable right so so
now uh we come to an end to this uh
lecture and now you can see that uh we
have considered here the probability
function for discrete and continuous
random
variable but in this case we have taken
only the univariate
case and now these definitions can be
extended to b variate trivariate or in
general a multivariate random variable
also and the same concept probability
density function probability Mass
function the way they have been defined
here they will be extended to by variate
or say higher order random variables and
if you try to think how to get it done
for example if you want to extend the
definition of probability density
function so you have taken here a
condition like as integral minus
infinity to Infinity F of XI DX f of x
DX should be equal to 1 now if you try
to extend it suppose you have more than
one variable X say say X and Y now you
will have double integral integral over
X integral over Y and the probability
density function will also involve two
random variables so instead of FX this
will become
fxy and when you are trying to integrate
that will become double integral fxy DX
Dy and this can be extended forward
extended to a p cross one random
variable also that you have P
Integrations F of X1 X2 XP then dx1 dx2
dxp so my basic objective in this
lecture and in the fourth coming lecture
is not to introduce you with the
univariate random variables or
univariate probability distributions but
my objective is that I want to extend
this concept to a multivar
setup in this lecture I have consider
only the scalers when we are trying to
consider the B variate and multivariate
then we are going to consider the
vectors and matrices as as I said I have
given you here a very brief introduction
to the concepts like PDF pmf or say
cdfs they are not sufficient to
understand the entire probability
Theory but as you know that I have also
a limitation of time in this course so
my request will be that you please try
to pick up a good book and try to read
this
concept and believe me once you
understand understand the basic concept
I can promise you it will be a very easy
job for you to understand this lecture
and finding out different types of
probabilities finding understanding
probability with distribution functions
Etc and there is a long list of
probability density functions and
probability Mass function which have
been defined in the
statistics but surely we are not going
to do all of them here I will try to do
here only the those PDFs which I will be
needing in the forthcoming l lectures
but if you want to expand your knowledge
you need to look into the books so you
try to look into the books try to take
some examples from the book try to solve
them in theory and I will see you in the
next lecture where I will try to explain
you with the B variate and multivariate
concepts related to the random variable
so you try to practice you try to read
and I will see you in the next lecture
till then
[Music]
goodbye
[Music]
[Music]
[Music]
