Table of Contents

  1. What is a Probability Distribution Function?
  2. Visualization of the Area under curve
  3. Normal Curve
  4. R Code Implementation
  5. Interactive Density Plot
  6. 3D Probability Surface
  7. Real world application of the concept
  8. Summary

What is a Probability Distribution Function?

It is a curve that shows how likely the different outcomes are.
The area under curve should be 1 or 100%.

We find the area under the curve by integration. If we are given a curve and we want to find the probability of an event that falls within a certain range then we find the area under the curve for that specific range.

Let’s say we want to find the probability of value \(X\) that falls between two points \(a\) and \(b\):

\[P(a\le X\le b)=\int_{a}^{b}f(x)\,dx\]

For a function to be a valid probability function the total area from negative infinity to infinity should be 1:

\[\int_{-\infty}^{\infty}f(x)\,dx=1\]

Visualization of the Area under curve

If we look at a Uniform Distribution where every outcome is equally likely then it would create just a simple rectangle.

Let’s assume that we have a normal distribution with standard deviation = 1 and mean = 0.

Given question: find the probability that X < 1.96

## [1] "The probability (area) is: 0.975"

Normal Curve

The probability density function of the standard normal distribution is

\[ f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2} \]

R Code Implementation

xValues<-seq(-4,4,length.out=200)
yValues<-dnorm(xValues)
dfnorm<-data.frame(x=xValues,y=yValues)
ggplot(dfnorm,aes(x,y))+geom_line(color="lightpink",size=1)+
  geom_area(fill="lightcoral",alpha=0.2)+theme_minimal()+
  labs(title="The Standard Normal Curve",
       subtitle="Total Area=1")

Interactive Density Plot

3D Probability Surface

Real World Application of the concept

This concept is used in many real world applications like:

  1. Used in Weather Forecasting for predicting the likelihood of rain or temperature.
  2. Its also used in machine learning and AI cause many algorithms assume that data follows a normal distribution to make the prediction.
  3. Used in finance in stock markets to estimate the probability of returns and financial risks.

Summary

  1. Probability distributions describe how outcomes are spread.
  2. The area under a probability curve represents probability
  3. The total area under any probability density function must equal 1.
  4. Uniform distributions show equal likelihood of outcomes.
  5. Normal distributions are bell-shaped and very common in statistics.
  6. R allows us to visualize probability distributions interactively.