CDF Calculator

CDF Visualization

Bernoulli Distribution CDF

The CDF of a Bernoulli random variable gives the probability that the random variable X is less than or equal to a specific value x.

\[ F(x) = \begin{cases} 0, & \text{if } x < 0 \\ 1-p, & \text{if } 0 \leq x < 1 \\ 1, & \text{if } x \geq 1 \end{cases} \]

Properties:

  • CDF is a step function for discrete distributions
  • CDF is non-decreasing: \(F(x_1) \leq F(x_2)\) when \(x_1 \leq x_2\)
  • Limits: \(\lim_{x \to -\infty} F(x) = 0\) and \(\lim_{x \to \infty} F(x) = 1\)

Understanding the Cumulative Distribution Function

Definition & Properties

The Cumulative Distribution Function (CDF) of a random variable X, denoted by F(x), gives the probability that X takes a value less than or equal to x.

\[ F_X(x) = P(X \leq x) \]

Key Properties of CDF:

  • Monotonically increasing: \(F_X(x_1) \leq F_X(x_2)\) whenever \(x_1 \leq x_2\)
  • Right-continuous: \(\lim_{x \to a^+} F_X(x) = F_X(a)\)
  • Range is [0, 1]: \(0 \leq F_X(x) \leq 1\) for all x
  • Limiting behavior: \(\lim_{x \to -\infty} F_X(x) = 0\) and \(\lim_{x \to \infty} F_X(x) = 1\)

Calculating Interval Probabilities

For any interval [a, b], the probability that X falls in this interval can be calculated using the CDF:

\[ P(a \leq X \leq b) = F_X(b) - F_X(a) \]

For continuous distributions, \(P(a \leq X \leq b) = P(a < X \leq b) = P(a \leq X < b) = P(a < X < b)\)

Discrete vs. Continuous CDFs

Discrete Random Variables:

For a discrete random variable X with PMF p(x), the CDF is:

\[ F_X(x) = \sum_{t \leq x} p(t) \]

The CDF is a step function that jumps at each value in the support of X.

Continuous Random Variables:

For a continuous random variable X with PDF f(x), the CDF is:

\[ F_X(x) = \int_{-\infty}^{x} f(t) \, dt \]

The CDF is a continuous function, and its derivative (when it exists) is the PDF:

\[ f(x) = \frac{d}{dx} F_X(x) \]

Example: Exponential Distribution

For an exponential distribution with parameter λ, the CDF is:

\[ F_X(x) = \begin{cases} 1 - e^{-\lambda x}, & \text{if } x \geq 0 \\ 0, & \text{if } x < 0 \end{cases} \]

Relationship Between PMF/PDF and CDF

From PMF to CDF (Discrete)

For a discrete random variable, the CDF is the sum of the PMF values up to the given point:

\[ F_X(x) = \sum_{t \leq x} P(X = t) \]

From PDF to CDF (Continuous)

For a continuous random variable, the CDF is the integral of the PDF up to the given point:

\[ F_X(x) = \int_{-\infty}^{x} f_X(t) \, dt \]

From CDF to PMF (Discrete)

For a discrete random variable, the PMF can be obtained from the CDF by looking at the jumps:

\[ P(X = x) = F_X(x) - \lim_{t \to x^-} F_X(t) \]

From CDF to PDF (Continuous)

For a continuous random variable, the PDF is the derivative of the CDF:

\[ f_X(x) = \frac{d}{dx} F_X(x) \]

Applications of CDF

Quantiles & Percentiles

CDFs are used to determine quantiles (e.g., median, quartiles) by finding the value x such that F(x) equals the desired probability. This is crucial in statistics for summarizing data distributions.

Random Number Generation

The inverse transform sampling method uses the inverse of the CDF to generate random numbers from any probability distribution, making it fundamental for simulations and Monte Carlo methods.

Risk Assessment

CDFs help quantify the probability of rare events and assess risk in finance, insurance, and engineering. Value-at-Risk (VaR) in finance is a specific quantile of a loss distribution's CDF.

Statistical Tests

Many statistical tests like the Kolmogorov-Smirnov test compare empirical CDFs to theoretical ones to determine if a sample comes from a specific distribution, essential for validating statistical models.

Test Your Knowledge

Quick Quiz: Cumulative Distribution Function

1. Which of the following statements about a CDF is FALSE?

A. The CDF is always non-decreasing
B. The CDF approaches 1 as x approaches infinity
C. The CDF can take negative values for some distributions
D. The CDF approaches 0 as x approaches negative infinity

2. If F(x) is the CDF of a continuous random variable, what is P(a < X ≤ b)?

A. F(a) - F(b)
B. F(b) - F(a)
C. 1 - F(a) - F(b)
D. F(a) + F(b)