[Math] Commonly used Vector derivatives.
·
.../Math
많이 사용되는 vector 도함수들을 정리함. Numeartor Layout 과 Denominator Layout을 구분하여 살펴야 함. $$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{b}^T \textbf{x}$$ $$\textbf{b}^T$$ Numerator Layout $$bx$$ $$b$$ $\textbf{b}\cdot \textbf{x}$ or $\textbf{x}\cdot \textbf{..
[Statistics] Covariance vs. Correlation
·
.../Math
Covariance vs. CorrelationCovariance (공분산)"Covariance" is the raw version of correlation.두 random variable(확률변수)가 얼마나 (선형적으로) 같이 변하는 정도를 나타냄.여러 random variables 에서는 matrix로 기재됨(covariance matrix, $\Sigma$).main diagonal은 자기자신과의 covariance, 즉 해당 확률변수 하나에 대한 variance임.matrix로 보여지는 경우엔 여러 random variable들이 있고 이들 중에 나올 수 있는 쌍에서의 covariance를 보여줌.항상 symmetric matrix 임. (every symmetric matrix is ortho..
[Statistics] Sample Point Method
·
.../Math
확률을 구하기위한 가장 기본적인 방법. Random experiment (or Random trial)에 따른 Sample space $S$를 정의. Sample space의 각 element (=sample point)들에 대한 probability(확률값)을 할당. 확률을 알고자 하는 event ( The subset of sample space)에 속하는 element를 정의. 확률을 알고자 하는 element에 속하는 모든 element (=sample point)들의 probability를 더해서 해당 event의 확률을 구함. 예제: 모양과 색깔이 같은 감기약 두 알과 두통약 두 알이 한 병에 있을 때, A, B 두사람이 한 알씩 꺼낼 경우, A가 감기약을 B가 두통약을 꺼낼 확률은? 풀이: ..
Closed-form solution and Closed-form expression
·
.../Math
Closed-form solution 💡 Solution(해)이 closed-form expression으로 주어진 것을 가르킴. 다음의 문장들 은 위와 같은 뜻. 방정식(equation)을 analytic method로 solution을 구할 수 있다. equation의 solution이 closed-form solution으로 표현된다 equation의 solution을 analytic하게 표현할 수 있다. equation에 analytic solution이 존재. 일반적으로 어떤 방정식(equation)에 대한 solution을 구할 때, 해당 solution이 closed-form expression으로 구해질 때, close-form solution을 가진다고 말한다. 대표적인 예가 quadra..
Normal Equation : Vector derivative 를 이용한 유도
·
.../Math
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\textbf{x} \Vert\\&=\text{arg } \underset{\text{x}}{\text{min} } \Vert \textbf{b}-A\textbf{x} \Vert ^2\\&=\text{arg } \underset{\text{x}}{\text{min} } (\textbf{b}-A\text..
One sample t-test : The Moon Illusion
·
.../Math
Kaufman and Rock (1962)의 실험 데이터 일부임. 달을 볼 때, 천공(zeneith or highest point)에 있는 달이 지평선에 가깝게 위치한 달에 비해 훨씬 작게 보이는 현상에 대한 실험임. (실제로 지평선의 달이 3배 가량 되는 것으로 알려짐) import numpy as np import pandas as pd import scipy.stats as stats obtained_ratio = [1.73, 1.06, 2.03, 1.40, 0.95, 1.13, 1.41, 1.73, 1.63, 1.56] df = pd.DataFrame(data=obtained_ratio, columns=['obtained_ratio']) print('sample size:',df.count()[0..