L2 Norm Matrix Equation Simplication

25 Views Asked by At

How do you get from

$\operatorname*{arg\,min}_{g} \dfrac{1}{2} \| y - X^Tg \|^2_2 + \dfrac{\lambda}{2} \| g \|^2_2$

to

$\operatorname*{arg\,min}_{g} \dfrac{1}{2}(y - X^Tg)^T(y - x^Tg) + \dfrac{\lambda}{2} g^Tg$ ?

X and y are both 1xN vectors. g is a scalar

I was thinking of using the closed-form solution for linear least squares, but it doesn't seem to fit in to this equation. I see this in some class notes, so I know it should just be one step between those 2 equations. Just not sure how.

Any thoughts? Thanks!