# Numerical solution to the constrained ridge regression

The constrained ridge regression problem is of the form: $$\arg\min_{\|\beta\|_2\le t}\|X\beta-y\|_2$$. Given a matrix $$X$$, a vector $$y$$ and the constrain parameter $$t$$, how do you solve it numerically?

I'm aware of the equivalent penalized form of ridge regression, which has a simple solution of the form $$(X^TX+\lambda I)^{-1}X^Ty$$. Unfortunately, my problem is given in the constrained form, and I don't know any analytical relation between $$t$$ and $$\lambda$$.

This is almost a specific optimization problem called a QCQP. The wikipedia article gives solvers that you can use to find the solution. Just use $$\lVert\cdot\rVert^2$$ instead of $$\lVert\cdot\rVert$$, this transforms both the objective and the constraint into quadratic forms in $$\beta$$.