This calculator helps you compute the probabilities of a log-normal distribution given the mean (μ) and standard deviation (σ) of the underlying normal distribution. You can calculate the probability of a value being less than, greater than, or between certain values. The distribution chart shows the probability density function (PDF) and cumulative density function (CDF) of the log-normal distribution.
Calculator
Parameters
This is the mean of the normal distribution of ln(X)
This is the standard deviation of the normal distribution of ln(X)
Must be positive for log-normal distribution
Distribution Chart
Learn More
Log-Normal Distribution
Definition: The log-normal distribution is a continuous probability distribution of a random variable whose logarithm follows a normal distribution. A random variable X has a log-normal distribution if Y = ln(X) has a normal distribution.
Where:
- is the mean of the underlying normal distribution (logarithm of the variable)
- is the standard deviation of the underlying normal distribution
- is the CDF of the standard normal distribution
- Mean:
- Median:
- Mode:
- Variance:
When to use the Log-Normal Distribution
The log-normal distribution is particularly useful for modeling variables that:
- Cannot be negative (restricted to positive values)
- Are positively skewed (right-skewed)
- Grow multiplicatively rather than additively
Relationship with Normal Distribution
Key relationship: If X follows a log-normal distribution with parameters μ and σ, then Y = ln(X) follows a normal distribution with mean μ and standard deviation σ.
This relationship allows us to use normal distribution calculations after transforming the data:
R Code Example
library(tidyverse)
mu <- 1.5
sigma <- 0.5
x1 <- 3
x2 <- 8
# P(X ≤ x1)
p_less_equal <- plnorm(x1, meanlog = mu, sdlog = sigma)
print(str_glue("P(X ≤ {x1}) = {round(p_less_equal, 4)}
"))
# P(X > x1)
p_greater_equal <- 1 - plnorm(x1, meanlog = mu, sdlog = sigma)
print(str_glue("P(X ≥ {x1}) = {round(p_greater_equal, 4)}
"))
# P(x2 < X < x1)
p_between <- plnorm(x2, meanlog = mu, sdlog = sigma) - plnorm(x1, meanlog = mu, sdlog = sigma)
print(str_glue("P({x1} ≤ X ≤ {x2}) = {round(p_between, 4)}
"))
log_normal_mean <- exp(mu + (sigma^2) / 2)
log_normal_median <- exp(mu)
log_normal_mode <- exp(mu - sigma^2)
log_normal_variance <- (exp(sigma^2) - 1) * exp(2 * mu + sigma^2)
log_normal_sd <- sqrt(log_normal_variance)
summary_stats <- tibble(
Statistic = c("Mean", "Median", "Mode", "Variance", "Std Dev", "P(X ≤ x₁)", "P(X ≥ x₁)", "P(x₁ ≤ X ≤ x₂)"),
Value = c(log_normal_mean, log_normal_median, log_normal_mode,
log_normal_variance, log_normal_sd,
p_less_equal, p_greater_equal, p_between),
Formula = c(
str_glue("exp(μ + σ²/2) = exp({mu} + {sigma}²/2)"),
str_glue("exp(μ) = exp({mu})"),
str_glue("exp(μ - σ²) = exp({mu} - {sigma}²)"),
str_glue("(exp(σ²) - 1)exp(2μ + σ²) = (exp({sigma}²) - 1)exp(2*{mu} + {sigma}²)"),
str_glue("√Variance"),
str_glue("P(X ≤ {x1})"),
str_glue("P(X ≥ {x1})"),
str_glue("P({x1} ≤ X ≤ {x2})")
)
)
print(summary_stats)
P(X ≤ 3) = 0.2111 P(X ≥ 3) = 0.7889 P(3 ≤ X ≤ 8) = 0.6657 ==================================== # A tibble: 8 × 3 Statistic Value Formula <chr> <dbl> <chr> 1 Mean 5.08 exp(μ + σ²/2) = exp(1.5 + 0.5²/2) 2 Median 4.48 exp(μ) = exp(1.5) 3 Mode 3.49 exp(μ - σ²) = exp(1.5 - 0.5²) 4 Variance 7.33 (exp(σ²) - 1)exp(2μ + σ²) = (exp(0.5²) - 1)exp(2*1.5 + 0.5²) 5 Std Dev 2.71 √Variance 6 P(X ≤ x₁) 0.211 P(X ≤ 3) 7 P(X ≥ x₁) 0.789 P(X ≥ 3) 8 P(x₁ ≤ X ≤ x₂) 0.666 P(3 ≤ X ≤ 8)
Python Code Example
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import pandas as pd
# Parameters for the log-normal distribution
mu = 1.5
sigma = 0.5
log_normal_mean = np.exp(mu + sigma**2/2)
log_normal_median = np.exp(mu)
log_normal_mode = np.exp(mu - sigma**2)
log_normal_variance = (np.exp(sigma**2) - 1) * np.exp(2*mu + sigma**2)
log_normal_sd = np.sqrt(log_normal_variance)
print("Log-normal distribution properties:")
print(f"Mean: {log_normal_mean:.4f}")
print(f"Median: {log_normal_median:.4f}")
print(f"Mode: {log_normal_mode:.4f}")
print(f"Variance: {log_normal_variance:.4f}")
print(f"Standard deviation: {log_normal_sd:.4f}")
print()
x1 = 3
x2 = 8
# P(X ≤ x1)
p_less_equal = stats.lognorm.cdf(x1, s=sigma, scale=np.exp(mu))
print(f"P(X ≤ {x1}) = {p_less_equal:.4f}")
# P(X ≥ x1)
p_greater_equal = 1 - stats.lognorm.cdf(x1, s=sigma, scale=np.exp(mu))
print(f"P(X ≥ {x1}) = {p_greater_equal:.4f}")
# P(x1 ≤ X ≤ x2)
p_between = stats.lognorm.cdf(x2, s=sigma, scale=np.exp(mu)) - stats.lognorm.cdf(x1, s=sigma, scale=np.exp(mu))
print(f"P({x1} ≤ X ≤ {x2}) = {p_between:.4f}")