[Math] Normal Equation : Vector derivative(Numerator Layout)를 이용한 유도

2022. 6. 1. 08:57·.../Math
728x90
728x90

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}-A\textbf{x})^T(\textbf{b}-A\textbf{x})\\
&=(\textbf{b}^T-\textbf{x}^TA^T)(\textbf{b}-A\textbf{x})\\
&=\textbf{b}^T\textbf{b}-\textbf{x}^TA^T\textbf{b}-\textbf{b}^TA\textbf{x}+\textbf{x}^TA^TA\textbf{x}\\
\end{aligned}$$

더보기

OLS는 다음을 참고

2022.04.28 - [.../Math] - Ordinary Least Squares : OLS, 최소자승법

 

Ordinary Least Squares : OLS, 최소자승법

Solution을 구할 수 없는 Over-determined system에서 solution의 근사치(approximation)을 구할 수 있게 해주는 방법임. Overtermined system은 linear system (연립방정식)에서 지나치게 식이 많아서 모든 식을..

dsaint31.tistory.com

denominator layout으로 전개한 글은 다음을 참고

2022.04.28 - [.../Math] - 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}} \Vert \textbf{b}-A..

dsaint31.tistory.com

 

 

 

필요한 Vector Calculus 공식(?)은 다음과 같음. (Numerator Layout임)

  • $\frac{\partial A\textbf{x}}{\partial \textbf{x}} = A$
  • $\frac{\partial \textbf{x}^TA}{\partial \textbf{x}} = A^T$
  • $\frac{\partial \textbf{x}^TS\textbf{x}}{\partial \textbf{x}} = \textbf{x}^TS$
더보기

2022.05.05 - [.../Math] - Commonly used Vector derivatives.

 

Commonly used Vector derivatives.

$$f(\textbf{x})$$ $$\frac{\partial f(\textbf{x})}{\partial \textbf{x}}$$ Convention $$f(x)$$ $$\frac{df(x)}{dx}$$ $$\textbf{x}^T \textbf{b}$$ $$\textbf{b}^T$$ Numerator Layout $$bx$$ $$b$$ $$\textbf..

dsaint31.tistory.com

2022.05.08 - [.../Math] - [Math] Matrix Calculus : Numerator Layout

 

[Math] Matrix Calculus : Numerator Layout

원본 : [Matrix Calculus](https://souryadey.github.io/teaching/material/Matrix_Calculus.pdf) 가급적 원본을 꼭 보길 권함. 1. Notation Scalar는 lower case letter로 표기. Vector는 lower case bold letter..

dsaint31.tistory.com

 

기본적인 Transpose 공식(?)은 다음과 같음.

  • $(\textbf{x}^T\textbf{b})^T=\textbf{b}^T\textbf{x}$
  • $(A^T\textbf{x})^T=\textbf{x}^TA$

 

최소값에서 1st order derivative는 0 인 점을 이용하여 위 식에서 solution $\hat{\textbf{x}}$를 구함.

$$\begin{aligned} \frac{\partial \|\textbf{b}-A\hat{\textbf{x}}\|_2^2}{\partial\hat{\textbf{x}}}&= \frac{\partial (\textbf{b}^T\textbf{b}-\hat{\textbf{x}}^TA^T\textbf{b}-\textbf{b}^TA\hat{\textbf{x}}+\hat{\textbf{x}}^TA^TA\hat{\textbf{x}}) }{\partial \hat{\textbf{x}}} \\
&=-(A^T\textbf{b})^T-\textbf{b}^TA+2\hat{\textbf{x}}^TA^TA\\
&=0 \end{aligned}$$

이를 정리하면 solution $\hat{\textbf{x}}$에 대한 closed-form expression을 얻음.

$$\begin{aligned}
2\hat{\textbf{x}}^TA^TA&=(A^T\textbf{b})^T+\textbf{b}^TA\\
2(\hat{\textbf{x}}^TA^TA)^T&=\left[ (A^T\textbf{b})^T +\textbf{b}^TA \right]^T \\
2A^TA\hat{\textbf{x}}&=\left[ \textbf{b}^TA +\textbf{b}^TA \right]^T \\
2A^TA\hat{\textbf{x}}&=\left[ 2\textbf{b}^TA \right]^T \\
2A^TA\hat{\textbf{x}}&=2A^T\textbf{b}\\
A^TA\hat{\textbf{x}}&=A^T\textbf{b}\\
\hat{\textbf{x}}&=(A^TA)^{-1}A^T\textbf{b} \\
\end{aligned}$$

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

[Math] Odds (승산, 승률)  (0) 2022.06.06
[ML] Likelihood (우도, 기대값)  (0) 2022.06.02
[Math] 필요조건, 충분조건, 필요충분조건  (0) 2022.05.19
[Math] Plane Equation : 평면의 방정식  (0) 2022.05.19
[Math] Orthogonal Projection (정사영)  (0) 2022.05.19
'.../Math' 카테고리의 다른 글
  • [Math] Odds (승산, 승률)
  • [ML] Likelihood (우도, 기대값)
  • [Math] 필요조건, 충분조건, 필요충분조건
  • [Math] Plane Equation : 평면의 방정식
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (748)
      • Private Life (13)
      • Programming (56)
        • DIP (112)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

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

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[Math] Normal Equation : Vector derivative(Numerator Layout)를 이용한 유도
상단으로

티스토리툴바