StatsCalculators.com

Log-Normal Distribution

Created:April 7, 2025
Last Updated:April 7, 2025

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

Click Calculate to view the 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.

Formula:The probability density function (PDF) and cumulative density function (CDF) are given by:f(x)=1xσ2πe(lnxμ)22σ2f(x) = \frac{1}{x\sigma\sqrt{2\pi}} e^{-\frac{(\ln x-\mu)^2}{2\sigma^2}}F(x)=P(Xx)=Φ(lnxμσ)F(x) = P(X \leq x) = \Phi \left({\frac {\ln x-\mu }{\sigma }}\right)

Where:

  • μ\mu is the mean of the underlying normal distribution (logarithm of the variable)
  • σ\sigma is the standard deviation of the underlying normal distribution
  • Φ\Phi is the CDF of the standard normal distribution
Important Properties:
  • Mean: E[X]=eμ+σ22E[X] = e^{\mu + \frac{\sigma^2}{2}}
  • Median: M=eμM = e^{\mu}
  • Mode: Mo=eμσ2Mo = e^{\mu - \sigma^2}
  • Variance: Var[X]=(eσ21)e2μ+σ2Var[X] = (e^{\sigma^2} - 1)e^{2\mu + \sigma^2}

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:

  • P(Xx)=P(ln(X)ln(x))=P(Yln(x))P(X \leq x) = P(\ln(X) \leq \ln(x)) = P(Y \leq \ln(x))
  • P(aXb)=P(ln(a)Yln(b))P(a \leq X \leq b) = P(\ln(a) \leq Y \leq \ln(b))
Example: If ln(X) follows N(0, 1), find P(1 ≤ X ≤ 5).P(1X5)=P(ln(1)ln(X)ln(5))=P(0Y1.61)=Φ(1.61)Φ(0)0.4463P(1 \leq X \leq 5) = P(\ln(1) \leq \ln(X) \leq \ln(5)) = P(0 \leq Y \leq 1.61) = \Phi(1.61) - \Phi(0) \approx 0.4463

R Code Example

R
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

Python
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}")

Related Calculators