Unbiased Estimator란?

·2025년 2월 6일

편향(Bias)이란?

확률모델의 학습에서 우리의 목적은 주어진 샘플 (데이터) x1,x2,...,xn으로부터 데이터를 생성한 확률분포 p(x|θ)의 참된 매개변수 θ를 찾는 것이다. 그러나 대부분의 머신러닝 응용에서는 모든 데이터를 관측할 수 없기 때문에 추정된 매개변수 θ~는 참된 매개변수 θ와 차이가 있을 것이다. 통계학에서 편향 (bias)은 추정된 매개변수와 참된 매개변수의 차이를 말하며, 편향은 추정된 매개변수의 기댓값을 기반으로 식 (1)과 같이 정의된다.

(1)    Bias(θ~,θ)=Ep(xθ)[θ~]θ(1)\space\space\space\space Bias(\tilde{\theta}, \theta) = \mathbb{E}_{p(x|\theta)}[\tilde{\theta}]-\theta

  • θ~\tilde{\theta}은 샘플 데이터로부터 추정한 모집단 매개변수, θ\theta는 실제 모집단 매개변수
  • 식의 기댓값 부분: 샘플 데이터로부터 추정한 매개변수 θ~\tilde{\theta}의 기댓값

Unbiased Estimator와 Biased Estimator의 정의

Unbiased estimator와 biased estimator는 식 (1)을 기반으로 아래와 같이 정의된다.

  • Unbiased estimator: 추정한 θ~\tilde{\theta}에 대해 (1)    Bias(θ~,θ)=Ep(xθ)[θ~]θ=0(1)\space\space\space\space Bias(\tilde{\theta}, \theta) = \mathbb{E}_{p(x|\theta)}[\tilde{\theta}]-\theta = 0 인 모델
  • Biased estimator: 추정한 θ~\tilde{\theta}에 대해 (1)    Bias(θ~,θ)=Ep(xθ)[θ~]θ0(1)\space\space\space\space Bias(\tilde{\theta}, \theta) = \mathbb{E}_{p(x|\theta)}[\tilde{\theta}]-\theta \neq 0 인 모델

표본평균 (Sample Mean)과 Unbiased Estimator

평균이 μ\mu인 확률분포에서 추출된 nn개의 서로 독립인 샘플 X1,X2,...,XnX_1,X_2,...,X_n에 대해 표본평균 μ~\tilde\mu의 기댓값은 아래의 식 (2)와 같다.

E[μ~]=E[1ni=1nXi]=1ni=1nE[Xi]=1ni=1nμ=μ\mathbb{E}[\tilde{\mu}] = \mathbb{E}\left[\frac{1}{n} \sum_{i=1}^{n} X_i\right] = \frac{1}{n} \sum_{i=1}^{n} \mathbb{E}[X_i] = \frac{1}{n} \sum_{i=1}^{n} \mu = \mu

따라서 E[μ~]μ=0\mathbb{E}[\tilde{\mu}] -\mu = 0이므로, 표본평균으로 확률분포의 평균 μ\mu를 계산하는 모델은 unbiased estimator이다.

표본분산 (Sample Variance)과 Biased Estimator

분산이 SS인 확률분포에서 추출된 nn개의 서로 독립인 샘플 X1,X2,...,XnX_1,X_2,...,X_n에 대해 표본분산 S~\tilde{S}의 기댓값은 아래의 식 (3)과 같다.

E[S~]=E[1ni=1n(Xiμ~)2]=1nE[i=1nXi22μ~i=1nXi+i=1nμ~2]=1n(i=1nE[Xi2]nE[μ~2])=1n(nS+nμ2Snμ2)=n1nSE[\tilde{S}] = E\left[\frac{1}{n} \sum_{i=1}^{n} (X_i - \tilde{\mu})^2\right] \\= \frac{1}{n} E\left[\sum_{i=1}^{n} X_i^2 - 2\tilde{\mu} \sum_{i=1}^{n} X_i + \sum_{i=1}^{n} \tilde{\mu}^2\right] \\= \frac{1}{n} \left( \sum_{i=1}^{n} E[X_i^2] - n E[\tilde{\mu}^2] \right) \\= \frac{1}{n} \left( nS + n\mu^2 - S - n\mu^2 \right) \\= \frac{n-1}{n} S

  • 여기서 사용된 법칙:
    • E[Xi2]=Var(Xi)+(E[Xi])2=S+μ2E[X_i^2]=Var(X_i)+(E[X_i])^2=S+μ^2
    • E[μ^2]=Var(μ^)+(E[μ^])2E[\hat\mu^2]=Var(\hat\mu)+(E[\hat\mu])^2 에서 E[μ~2]=σ2n+μ2E[\tilde{\mu}^2] = \frac{\sigma^2}{n} + \mu^2

따라서 E[S ]S0E[S~]−S≠0이므로, 표본분산으로 확률분포의 분산 SS를 계산하는 모델은 biased estimator이다.

분산을 추정하기 위한 unbiased estimator는 식 (3)에서 nn으로 나누는 것이 아니라, n1n−1로 나누는 것이다. 만약 n1n−1로 나눈다면 표본분산은 아래와 같이 실제 분산 SS와 같아진다.

따라서 n1n−1로 나눈 estimator에서는 식 (4)와 같이 E[S ]S=0E[S~]−S=0이므로, 이 모델은 확률분포의 분산을 추정하기 위한 unbiased estimator이다.

profile
보건대학원 뉴비

0개의 댓글