Log Normal Distribution(로그 정규 분포)

Log Normal Distribution은 Log를 취하면 Normal Distribution을 따르는 Random Variable에 대한 Distribution이다. PDF(Probability Density Function)는 다음과 같다.

$$f(x)=\frac{1}{x\sigma \sqrt{2\pi}}exp\left ( -\frac{\left ( lnx-\mu  \right )^{2}}{2\sigma ^{2}} \right ), ;;for ; x > 0, ; s > 0$$

image

Relation between normal and log-normal distribution. $If Y= \mu + \sigma Z$ is normally distributed, then $X \sim  e^Y$s log-normally distributed( Source: Wikipedia).

Python으로는 다음과 같이 scipy 패키지를 이용해서 사용할 수 있다. Parameter로는  $\sigma$와 Scale에 관한 값 등을 받는다.

import math
import numpy as np
from scipy.stats import lognorm
import matplotlib.pyplot as plt
np.random.seed(2023)
lognorm_values = lognorm.rvs(s=1, scale=math.exp(1), size=1000)
plt.hist(lognorm_values, density=True, edgecolor='black')

Log Normal Distribution은 Poisson Distribution과 같이 양수인 Variable만을 가진다. Normal Distribution과 다른 부분이다. Log Normal Distribution이 중요한 이유는 Human Behavior나 Social Science에서의 다양한 현상들을 설명하기에 적합한 Distribution이기 때문이다. 예를 들어 소수에게 편중되어 있는 형태로 나타나는 소득분포가 그렇다. 전형적인 Long Tail Distribution을 묘사할 때 쓰기에 좋은 분포이다.

The Model Thinker를 읽다보니 알게 되어 이렇게 정리해놓는다.