[Statistics] Central Limit Theorem

2022. 3. 31. 15:33·.../Math
728x90
728x90

Central Limit Theorem (중심극한정리)

mean의 sampling distribution의 다음과 같은 속성을 기술하는 Theorem이 Central Limit Theorem임.

population이 무엇이든지 간에
sample size ($N$, 1개의 sample의 element의 수)가 충분히 크다(흔히 30 or 40이상)면,
해당 sample의 mean (또는 합계치를 사용할 수도 있음) 을
random variable로 삼아 얻은 sampling distribution은
normal distribution에 가까워지고
population의 mean과 같은 mean을 가진다는 Theorem(정리).

 

표본의 mean 혹은 합계치 가 normal distribution이 된다는 것(즉, sampling distribution에 해당하는 내용임)이지

population이 항상 normal distribution임을 보장하는 정리가 아님을 주의할 것.

 

  • mean이 $\mu$, variance $\sigma^2$인 population에서
    한 sample이 $N$개의 element를 가지도록 sampling할 경우,
    해당 sampling을 여러 차례(ideal하게는 무한번 반복) 수행하여
    얻은 sample들의 mean 또는 합으로 구한
  • sampling distribution 의 mean과 variance는 다음과 같다.
    • $\mu_{\text{sample}}=\mu$
    • $\sigma^2_{\text{sample}}=\dfrac{\sigma^2}{N}$
  • $N$, sample size가 증가할 수록,
    해당 sampling의 mean의 sampling distribution은 normal distribution에 가까워지며(Central Limit Theorem에 의해),
    해당 sampling distribution의 mean은 population mean에 가까워짐(큰수의 법칙에 의해)
    (arithmetic mean으로 구한 경우)
    • population의 distribution이 어떤 형태이었던지에 상관없이
      sample들의 mean에 대한 sampling distribution은
      $N$이 커질수록 normal distribution이 된다. ◀ Central Limit Theorem!!
      • 만약 population도 normal distribution이면,
        sampling distribution of the mean 역시 normal distribution임.
      • population이 normal distribution이 아니더라도, $N\ge30$ 정도의 충분히 큰 sample size인 경우엔
        sampling distribution of the mean은 normal distribution을 가지게 됨.
    • 이때 $N$개의 element로 구성된 sample을 얻는 과정, 즉 sampling에서 각각의 샘플은 서로 독립(independent)이 되도록 얻어짐 (=random sampling).
    • 또한 모든 $N$개의 element로 구성된 sample은 같은 population에서 얻어져야 함.
  • 약 30 or 40개 이상의 sample을 수집하고 이들의 mean값을 해당 sample의 모집단의 mean으로 여겨도 된다는 애기임.)
약 30 or 40개 이상의 sample을 수집한 경우,
이들의 mean값을 해당 sample의 모집단의 mean의 좋은 추정치로 여길 수 있으며,
해당 sample mean의 분포는 normal distirbution이라고 근사해도
통계적으로 타당하다는 애기임. 

 

 

sampling error를 줄이기 위해 왜 sample size $N$이 커져야 하는지를 보여주는 theorem임.


요약.

  • 적절한 size $N \ge 30 \text{ or }40$의 sample들로 얻어진 sampling distribution은 항상 normal distribution이다.
  • 해당 samplint distribution 의 mean은 population의 mean임 : $ \mu_{\text{sample}}=\mu$. (The Law of Large Numbers)
  • 해당 samplint distribution 의 variance은 다음이 성립 : $\sigma^2_{\text{sample}}=\dfrac{\sigma^2}{N}$

2022.04.21 - [.../Math] - [Math] The Law of Large Numbers (or The weak law of large numbers)

 

[Math] The Law of Large Numbers (or The weak law of large numbers)

어떤 한 trial(시행)에서 사건 $A$가 일어날 수학적 확률(Analytic probability)이 $p$일 때,$n$번의 독립시행(independent trial)에서 사건 $A$가 일어나는 횟수를 $x$ 라고 하면,아무리 작은 양수 $\epsilon$을 택하

dsaint31.tistory.com

2025.09.16 - [.../Math] - sampling error vs. sampling bias

 

sampling error vs. sampling bias

Sampling Error (표본 오차, Sampling Noise)정의: population 에서 sampling을 수행할 때 random(우연)에 의해 발생하는 무작위적 변동(random variability). sampling에서 randomness를 피할수 없고 해당 sample에서 얻어진 sam

dsaint31.tistory.com

2024.02.23 - [.../Math] - [Math] Random Sampling

 

[Math] Random Sampling

Random SamplingRandom Sampling은 다음을 가르킴.Population(모집단)에서 element를 각각 무작위(random)로 선택하여 얻는sampling method(샘플링, 표본추출)을 가르킴. Statstics에서일반적으로 "제한된 수의 sample들로

dsaint31.tistory.com

 


Example 1

1이 될 확률이 $P$인 $N$번의 Bernoulli trial을 독립적으로 수행하고 결과값을 다 더한 경우,
해당 결과값의 확률분포는 Binomial distribution $(N,P)$를 따르게 됨.

Bernoulli distribution에서
estimated value(=mean)는 $P$이고,
standard deviation은 $\sqrt{P(1-P)}$임.

 

하지만, 이 분포를 population으로 삼아

$N$개의 element를 가지는 sample을 뽑아 이 element들을 더한 값을 random variable로 삼은 경우

$N$이 충분히 크다면,

mean이 $\mu_{N}=NP$ 이고

standard deviation은 $\sigma_{N}=\sqrt{NP(1-P)}$인 normal distribution이 된다.
($\sigma^2_N=\frac{N^2P(1-P)}{N}$)

  • $N\ge10$이고 $P\le0.1$ 인 경우, 즉 $N$이 비교적 크고 1이 될 확률이 아주 작은 경우에는 Poisson distribution 이 가까워짐.
  • $N$이 크고 $P$가 아주 작지 않은 경우에는, Normal distribution 에 가까워짐.
import numpy as np
import scipy as sp
import seaborn as sns
sns.set()
# 동전던지기에서 앞면이 나올 확률분포는 
# 정규분포가 아니나, 
# "동전을 10000번 던진 경우의 앞면이 나올 횟수"의 분포(sampling distibution)은 
# 정규분포임.
# 무한번 10000번 던져서 sampling distribution을 만들 수는 없으니
# 여기선 50000번 10000번 던지기를 수행..

n_size = 10000
n_trials = 50000

# head 1, tail 0
coin = np.array([0,1])
n_heads =np.zeros(n_trials)

np.random.seed(1)
for i in range(0, n_trials):
  n_heads[i] = sp.sum(
    np.random.choice(coin, size=n_size, replace=True)
  )

sns.distplot(n_heads, color = 'black')


Example 2

normal distribution이 population인 경우에서
sample의 사이즈에 따라, 분포가 퍼진 정도가 어떻게 달라지는지를 보여주는 script.

import numpy as np
from matplotlib import pyplot as plt

num_points = 10000
sample_size = 10

def get_population (mu, sigma, pop_size):
    return np.random.randn(pop_size)*sigma+mu

def get_sampling_dist(mu, sigma,sample_size, num_sampling, ibins=None, pop_size=100000, label=None, color=None):
    population  = get_population(mu,sigma,pop_size)

    sample_dist = np.zeros(num_sampling)
    for i in range(num_sampling):
        sample_idx = np.random.randint(pop_size, size=sample_size)
        samples_data = population[sample_idx]
        sample_dist[i] = np.mean(samples_data)

    #hist, bin_edges = np.histogram
    sample_sigma = sigma/np.sqrt(sample_size)
    if ibins is None:
        count, bins, ignored = plt.hist(sample_dist, bins='auto', density=True, color=color, label=label, alpha=0.5)
    else:
        count, bins, ignored = plt.hist(sample_dist, bins=ibins, density=True, color=color, label=label, alpha=0.5)
    plt.legend()
    plt.plot(bins, 1/(sample_sigma * np.sqrt(2 * np.pi)) *
             np.exp( - (bins - mu)**2 / (2 * sample_sigma**2) ),
             linewidth=2)


    return bins

ibins_10  = get_sampling_dist(50,10,10,10000,color='red', label='n=10')
ibins_30  = get_sampling_dist(50,10,30,10000,ibins_10,color='blue', label='n=30')
ibins_100 = get_sampling_dist(50,10,100,10000,ibins_10,color='gray', label='n=100')

 

sample의 사이즈($N$)이 10, 30, 100인 경우를 보여줌.

population의 parameter는 다음과 같음.

  • $\mu=50$
  • $\sigma=10$

References

Central Limit Theorem : summary

 

728x90

'... > Math' 카테고리의 다른 글

[Math] The Law of Large Numbers (or The weak law of large numbers)  (0) 2022.04.21
[Math] Definition of Vector Space and Sub-Space  (0) 2022.04.05
[Statistics] Moment (Probability Moment)  (0) 2022.03.31
[Math] Vector (2) : Vector Function  (0) 2022.03.28
[Math] Vector (1)  (1) 2022.03.28
'.../Math' 카테고리의 다른 글
  • [Math] The Law of Large Numbers (or The weak law of large numbers)
  • [Math] Definition of Vector Space and Sub-Space
  • [Statistics] Moment (Probability Moment)
  • [Math] Vector (2) : Vector Function
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (787)
      • Private Life (15)
      • Programming (206)
        • DIP (116)
        • ML (35)
      • Computer (120)
        • CE (54)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    linear algebra
    fourier transform
    SIGNAL
    Vector
    Term
    Optimization
    signals_and_systems
    SS
    opencv
    Python
    cv2
    random
    signal_and_system
    numpy
    math
    Probability
    인허가제도
    ML
    Programming
    function
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[Statistics] Central Limit Theorem
상단으로

티스토리툴바