Much like this post: Quadratic Programming and Lasso, I'm trying to integrate RIDGE Penalty in a dedicated quadratic solver. In my case, I am working with quadprog from MATLAB. Unlike LASSO where you can eliminate the absolute value in the constrained form and rewrite them in linear form (effectively keeping a quadratic problem), you can't with RIDGE. This means that in order to have a quadratic problem, I have to work with the penalty form:
$$ RIDGE: \sum_{i=1}^{N} (y - x'\beta)^2 + \lambda \sum \beta_{i}^{2}$$
My explicit problem is to minimize the variance with added RIDGE Penalty.
$${\underset{w}{\arg\min}} \frac{1}{2} w' \Sigma w \ + \lambda \sum w_i^{2}$$ $$s.t. \ \sum_{i=1}^{N} w_i = 1$$
Basically, I want to minimize the variance while summing the weights to 1. A pretty standard problem in finance. My question is: How to adapt the objective function so that it includes the penalty? When working with a dedicated solver like quadprog, you can only specify the positive definite squared matrix and the vector for the unsquared terms. With the formulation below, you then specify $H$ and $f$. Link: https://www.mathworks.com/help/optim/ug/quadprog.html
$${\underset{x}{\arg\min}} \frac{1}{2} x' H x \ + f'x$$
I can either modify H (which is my covariance matrix), but this would change the number of values in my $w$ vector, or I could work with $f'$, but this is for unsquared term. I need to implement $\lambda x'x$ in my objective function, which is equal to $\lambda \sum x_i^{2}$.
EDIT: I forgot to mention, but $\lambda$ is arbitrarily given. I will optimize for multiple values. Cross-validation has been considered, but it's complicated for time-series and I might just choose multiple values myself.