Post

covariance matrix

πŸ™…β€β™‚οΈνœ΄λŒ€ν°μœΌλ‘œ λ³Ό λ•Œ ν˜Ήμ‹œ κΈ€μžλ‚˜ μˆ«μžκ°€ 화면에 λ‹€ μ•ˆλ‚˜μ˜€λ©΄, νœ΄λŒ€ν° κ°€λ‘œλ‘œ λŒλ¦¬μ‹œλ©΄ λ©λ‹ˆλ‹€

3λͺ…μ˜ ν”Όμ‹€ν—˜μžκ°€ μžˆλ‹€κ³  κ°€μ •ν•˜μž
ν”Όμ‹€ν—˜μž1은 μ‚¬κ³Όλ‚˜ λ°”λ‚˜λ‚˜λ₯Ό 먹으면 λ‘˜λ‹€ λ§Œμ‘±λ„1을 μ–»λŠ”λ‹€.
ν”Όμ‹€ν—˜μž2λŠ” 사과λ₯Ό 먹으면 λ§Œμ‘±λ„3을 μ–»κ³  λ°”λ‚˜λ‚˜μ—μ„œλŠ” 얻지 λͺ»ν•œλ‹€.
ν”Όμ‹€ν—˜μž3은 μ‚¬κ³Όλž‘ λ°”λ‚˜λ‚˜λ₯Ό λ¨Ήμ„λ•Œ 각각 λΆˆλ§Œμ‘±λ„ -1을 μ–»λŠ”λ‹€
(μ•„λ¬΄νŠΌ 과일을 정말 μ‹«μ–΄ν•œλ‹€λŠ” λœ»μ΄λ‹€)

λŒ€μƒμ‚¬κ³Όλ°”λ‚˜λ‚˜Β 
ν”Όμ‹€ν—˜μž111Β 
ν”Όμ‹€ν—˜μž230Β 
ν”Όμ‹€ν—˜μž3-1-1

μ•„λž˜λŠ” \(R^2\) μ’Œν‘œμ—μ„œ ν”Όμ‹€ν—˜μž 3λͺ…을 각 λ²‘ν„°λ‘œ λ‚˜νƒ€λ‚Έ 것이닀

Desktop View

λ³€μˆ˜λŠ” x,yκ°€ 각각 사과, λ°”λ‚˜λ‚˜λ‘œ 2κ°œλ‹€
κ·Έλž˜μ„œ 2x2 행렬이 λ˜κ² λ‹€
\(\begin{bmatrix} cov(x,x) & cos(x,y) \\cov(y,x) & cos(y,y) \end{bmatrix}\)

Desktop View

μ—¬κΈ°μ„œ cov(사, 사)λŠ” 사과와 μ‚¬κ³ΌλΌλ¦¬μ˜ 곡뢄산을 λ‚˜νƒ€λ‚Έ 것인데 μ΄λŠ” var(사)둜 λ°”κΏ€ μˆ˜λ„ μžˆλ‹€
λ§ˆμ°¬κ°€μ§€λ‘œ cov(λ°”, λ°”) $\Rightarrow$ var(λ°”)
이제 covariance matrixλ₯Ό μ±„μš°κΈ° μœ„ν•΄ 사과와 λ°”λ‚˜λ‚˜μ˜ 평균 κ³„μ‚°ν•˜μž
\(사과m \Rightarrow \frac{1+3-1}{3} \rightarrow 1\)
\(λ°”λ‚˜λ‚˜m \Rightarrow \frac{1+0-1}{3} \rightarrow 0\)

covariance matrix process

\(Cov(A,B)\\=E(AB)-E(A)E(B)\)

μ—¬κΈ°μ„œ E(AB)λŠ” 사과xλ°”λ‚˜λ‚˜λ‹ˆκΉŒ 각각 κ³±ν•΄ λ”ν•˜λ©΄ 1, 0, 1 λ‚˜μ˜¨λ‹€
근데 3κ°œλ‹ˆκΉŒ \(\frac{1+0+1}{3} \Rightarrow \frac{2}{3}\)
자 근데 κ°€λ§Œλ³΄λ‹ˆ E(B)λŠ” \(\frac{1}{3}+\frac{0}{3}-\frac{1}{3}=0\) 이 λ˜κΈ°μ— E(A)E(B)λŠ” μ˜λ―Έκ°€ μ—†μ–΄μ§€λ―€λ‘œ E(AB)만 κ΅¬ν•˜λ©΄ λ˜κ² λ‹€

자 그럼 μ΄λ²ˆμ—” cov(사, 사)λ₯Ό κ΅¬ν•΄λ³΄μž
\(Cov(A,A)\\=E(A^2)-E(A)\)
\(E(A^2) \Rightarrow \frac{1^2+3^2+(-1)^2}{3} = \frac{11}{3}\)
\(E(A) \Rightarrow \frac{1+3-1}{3} = 1\)
\(\therefore \frac{11}{3}-1 = \frac{8}{3}\)

λ§ˆμ§€λ§‰μœΌλ‘œ cov(λ°”, λ°”)λ₯Ό κ΅¬ν•˜μž
\(Cov(B,B)\\=E(B^2)-E(B)\)

μ•„κΉŒ E(B)=0 μ΄μ—ˆμœΌλ‹ˆ 이건 제끼자
\(E(B^2) \Rightarrow \frac{1^2+0^2+(-1)^2}{3} = \frac{2}{3}\)
\(\therefore \frac{2}{3}-0 = \frac{2}{3}\)

$\color{red}{\therefore}$covariance matrix

\(\begin{bmatrix} \frac{8}{3} & \frac{2}{3} \\ \frac{2}{3} & \frac{2}{3} \end{bmatrix}\)

μ°Έκ³ 

[ritvikmath] Β Β  covariance matrix

This post is licensed under CC BY 4.0 by the author.
3D GIF