In the previous note on random variables, we have seen what a random variable is, types of random variables based on the sample space, and the difference between discrete and continuous random variables. In this note, we will further extend the continuous random variables concept and explore how probability density function (PDF) and cumulative distribution function (CDF) are related to continuous random variables along with handon using python programming language.
In simple words, whenever an experimental setup or sample space contains the real numbers or subset of real numbers, we use a continuous random variable concept to model it mathematically. Further, to extract meaningful information from the continuous random variable, we use different tools such as probability density and cumulative distribution functions that give statistical data about that random variable. And using that information, we can learn and understand more about that variable statistically rather than by random guessing.
Introduction
We know that a sample space is continuous if it contains an interval (either finite or infinite) of real numbers. Whereas, a sample space is discrete if it contains a finite or countable infinite set of outcomes.
In general, we can say that it is mandatory to know for all possible A which are subsets of R. Where . Suppose, If we choose A = , we have
tells what is the probability of random variable (X) where X takes values less than or equal to x. Basically, it gives rise to the definition of the cumulative distribution function.
Cumulative Distribution Function (CDF)
The cumulative distribution function, or more simply the distribution function, F of the random variable X is defined for any real number x by:
or is the probability that the random variable X takes on a value that is less than or equal to x.
Properties of Cumulative Distribution Function
- is a monotonically non-decreasing function. It means, if , it follows that .
- = 0. It means, the lower limit of F is 0.
- = 1. It means, the upper limit of F is 1.
- is continuous from the right.
In simple words, probability values are always positive or zero but never negative. The basic interpretation are as follows:
- Firstly, the CDF value computed given should be greater than the CDF value computed given if .
- Secondly, probability values are always bound between zero and one. So the cumulative probability values should not be greater than one on the upper side and should not be lower than zero at the lower size.
All probability about X can be computed in terms of its distribution function F. For example, suppose we want to compute:
Similarly, suppose we want to compute , then . Where is the left limit of CDF.
Mainly, CDF helps obtain the probabilities related to random events. It will understand with the help of an example.
Suppose the random variable X has distribution function:
The probability that X exceeds 1 is found as follows:
The above solution gives a cumulative probability value up to a particular range. In this case, the range is equal to the value of x. Now we will discuss how to find a probability at a particular event rather than up to certain events.
Continuous Random Variable
A continuous random variable is a random variable with an interval either finite or infinite of real numbers for its range. The characteristics of continuous random variables are that the number of possible outcomes is uncountable infinite and they have a continuous distributed function . It follows that the point probabilities are zero, i.e. P(X = x) = 0.
Continuous distribution function or Cumulative distribution function exists when a unique density function f exists such that .
Probability Density Function (PDF)
A random variable X is said to be continuous if there is a function f(x) such that for all .
holds. Where F(x) is the cumulative distribution function of X, and f(x) is the probability density function of X and if and only if all x that are continuity point of f.
Properties of Probability Density Function
For a function f(X) to be a probability density function of a continuous random variable X, it needs to satisty the following conditions:
- for all
The probability of a continuous random variable taking a particular value is always zero.
Relationship between PDF and CDF
Let X be a random variable with CDF F(x) where x is a known constant. . Suppose then
It is same as area under which is equal to
As we know, F(x) is the cumulative distribution function of X, and f(x) is the probability density function of X. So knowing the CDF we can find PDF.
if and only if all x that are continuity point of f.
Example 1: Finding the probability of a random variable.
For a probability density function f(x) of a continuous random variable is given as follows:
Suppose we want to find the probability of a continuous random variable in a range between a and b, which is as follows:
As shown below, the basic intuition is to find the probability area under the curve.
It motivates us to learn, having the data points from an experiment, how to find the PDF. And the example of a data point could be like the starting salary of a sample of 10000 students graduating in statistics. Probably, wages would always be in an integer number in this case. So we can say that these sample data points can be represented as a discrete random variable, and the method would be probability mass function and cumulative distribution function.
Example 2: Approximate a histogram to Probability density function
A histogram is an approximation to a probability density function. In the below diagram we can see that, for each interval of the histogram, the area of the bar equals the relative frequency of the measurements in the interval.
The relative frequency is an estimate of the probability that a measurement falls in the interval. Similarly, the area under f(x) over any interval equals the true probability that a measurement falls in the interval.
Example 3: Calculation of PDF and CDF.
Consider the continuous random variable waiting time for the train. Suppose that a train arrives every 20 minutes. Therefore, the waiting time of a particular person is random and can be any time contained in the interval [0,20]. We can start describing the required probability density function as
where k is an unknown constant.
The value of k for which f(x) is a PDF is:
Thus the PDF is
The CDF F(x) of f(x) is:
Suppose we are interested in calculating the probability of a waiting time between 15 and 20 minutes.
References
- Essentials of Data Science With R Software – 1: Probability and Statistical Inference, By Prof. Shalabh, Dept. of Mathematics and Statistics, IIT Kanpur.
CITE THIS AS:
“Continuous Random Variables” From NotePub.io – Publish & Share Note! https://notepub.io/notes/mathematics/statistics/statistical-inference-for-data-science/continuous-random-variables/
8,823 total views, 2 views today