Closed-form Solution


minimize the cost explicitly without relying on an iterative algorithm
1. take [Derivation](https://texonom.com/derivation-79d0547aee0d45ce93cdae0f26bc3ce6) of [Cost Function](https://texonom.com/cost-function-66c21423cc7347909016b3423f2ada7e) with respect to the model coefficient $\theta$
2. find [Local extremum point](https://texonom.com/local-extremum-point-f7a7579a29474436b2a8670a28fed921) 
### Normal Equation
$$X^TX^\theta - X^T\vec{y} = 0$$
number 1’s result is $d \times 1$ dimension if X is $n \times d$ vector (d is number of coefficient count)


Fancy but Inverse matrix is very expensive
$$\theta = (X^TX)^{-1}X^T\vec{y}$$







