Weighted Least Squares(WLS)는
- sample마다 error variance가 다를 수 있다고 보고,
- 각 residual 제곱항에 보통 $\frac{1}{\sigma_i^2}$에 비례하는 weight을 주어 추정하는 Least Squares 방법임.
아래와 같이 error term의 variance가 일정하지 않은 상태: $\text{Var}(\epsilon_i)=\sigma_i^2$
를 가리켜 Hetero(서로다른)scedasticity(흩어짐, 산포, dispersion)라고 하며
이 같은 경우 WLS를 사용해야 한다.

Weighted Least Sqaures는 각 샘플 포인트마다 weight을 다르게 주어 구하는 Least Squares임.
- OLS 의 경우, 모든 샘플 포인트에 동일한 weight을 줌.
- 이 차이는 이론적 error term $\epsilon_i$의 variance,
$\text{Var}(\epsilon_i)=\sigma^2$로 같다고 가정(OLS)할지,
$\text{Var}(\epsilon_i)=\sigma_i^2$로 각기 다르다(WLS)고 할지에 달려 있음. - 즉, WLS에선 샘플 포인트마다 error variance가 다르기 때문에 error variance가 큰 경우 residual이 클 확률이 높음.
때문에 weight를 error variance에 반비례하게 할당: $\omega_i \propto \frac{1}{\sigma_i^2}$ - 단, WLS는 OLS와 마찬가지로 각각의 $\epsilon_i$는 서로에 대해 독립이라고 가정.
즉, 서로간 covariance와 correlation이 0 임.
때문에 OLS는 모든 샘플 포인트의 weight이 같은 Weighted Least Squares라고 볼 수 있음.
OLS의 경우와 마찬가지로 closed form solution을 가짐.
2022.06.01 - [.../Math] - [Math] Normal Equation : Vector derivative(Numerator Layout)를 이용한 유도
[Math] Normal Equation : Vector derivative(Numerator Layout)를 이용한 유도
Orinary Least Square는 다음과 같은 최소화 문제임.$$\underset{\textbf{x}}{\text{argmin}}\|\textbf{b}-A\textbf{x}\|_2^2$$$\|\textbf{b}-A\textbf{x}\|_2^2$를 전개하면 다음과 같음.$$\begin{aligned}\|\textbf{b}-A\textbf{x}\|_2^2&=(\textbf{b
dsaint31.tistory.com
2022.04.28 - [.../Math] - Ordinary Least Squares : OLS, 최소자승법
Ordinary Least Squares : OLS, 최소자승법
Solution을 구할 수 없는 Over-determined system에서 solution의 근사치(approximation)을 구할 수 있게 해주는 방법임. Machine Learning에서 Supervised Learning의 대표적인 task인 Regression을 해결하는 가장 간단한 알고
dsaint31.tistory.com
Objective Function (=Loss function)에 기반하여 다음의 식으로 표현됨.
$$\begin{aligned} \hat{\textbf{x}} &= \text{arg } \underset{\text{x}}{\text{min}} \Vert W(A\textbf{x}-\textbf{b}) \Vert \\ &=\text{arg } \underset{\text{x}}{\text{min} } \Vert W (A\textbf{x}-\textbf{b}) \Vert ^2 \\ &=\text{arg } \underset{\text{x}}{\text{min} } \text{ loss_func} \end{aligned}$$
- $W$ 는 main diagnal이 각 샘플별 weight로 이루어지고, off-diagonal은 모두 0임: error variance가 서로에 대해 독립이므로!
- $W=\text{diag}(\sqrt{w_1}, \cdots, \sqrt{w_m})$ 으로, $m$은 샘플 포인트 수임.
이를 풀면 다음과 같음.
우선 최소값에서 1st derivative는 0을 만족해야함.
$$\begin{aligned} \frac{d \Vert W(A\textbf{x}-\textbf{b})\Vert ^2}{d\textbf{x}} &=2(WA)^\top W(A\textbf{x}-\textbf{b} ) \\ &=0 \end{aligned}$$
이로부터 구한 solution은 다음과 같음 (Normal Equation과 유사한 closed form equation).
$$\begin{aligned} \hat{\textbf{x}}&=(A^\top W^\top WA)^{-1}A^\top W^\top \textbf{b}\end{aligned}$$
같이 보면 좋은 자료들
2022.04.28 - [.../Math] - Normal Equation : Vector derivative 를 이용한 유도
Normal Equation : Vector derivative 를 이용한 유도
Normal Equation : Vector derivative 를 이용한 유도OLS (Ordinal Least Square)에서 approximation of solution $\hat{\textbf{x}}$는 다음을 만족해야 함.$$\begin{aligned}\hat{\textbf{x}} &= \text{arg } \underset{\text{x}}{\text{min}} \Ver
dsaint31.tistory.com
2022.04.29 - [.../Math] - Closed-form solution and Closed-form expression
Closed-form solution and Closed-form expression
Closed-form solution 💡 Solution(해)이 closed-form expression으로 주어진 것을 가르킴. 다음의 문장들 은 위와 같은 뜻. 방정식(equation)을 analytic method로 solution을 구할 수 있다. equation의 solution이 closed-form solu
dsaint31.tistory.com
'... > Math' 카테고리의 다른 글
| [Math] Homogeneous Coordinate and Projective Geometry (1) | 2024.06.16 |
|---|---|
| [CV] Intersection and Ideal Point; Homogeneous Coordinate and Cross Product (1) | 2024.06.16 |
| [ML] Bootstrap Sampling (2) | 2024.06.05 |
| [ML] Convex Problem (1) | 2024.06.01 |
| [Math] Importance of Continuous and Smooth Functions in Optimization Problems (1) | 2024.06.01 |