How to express the following summation in matrix form?

56 Views Asked by At

Given data X and Y in matrix form, consider estimating by minimizing the follwing:

$$ \sum_{i = 1}^n (y_i -x_i^T )^2 + \sum_{j = 1}^p (_j)^2 $$

where p is the dimension of X (number of variables). Find the estimate of B̂ in matrix form.

1

There are 1 best solutions below

0
On BEST ANSWER

$$(y-\underbrace{X}_{n\times p}\,\beta)^T\underbrace{(y-X\beta)}_{n \times 1}+\beta^T\underbrace{\beta}_{p \times 1}$$ To minimize, we first expand it $$y^Ty-y^TX\beta-\beta^TX^Ty+\beta^TX^TX\beta+\beta^T\beta= \\ =y^Ty-2\beta^TX^Ty+\beta^TX^TX\beta+\beta^T\beta$$ we take the derivative with respect to $\beta$, then set it to $0$: $$-2X^Ty+2X^TX\beta+2\beta=0$$ $$\beta=(X^TX+I_p)^{-1}X^Ty$$