I need to solve the following optimization problem. \begin{aligned} \min_{\lambda_0,\lambda_1} & \sum_{t=1}^T\sum_{n\in\{4,8,12,16\}} \left(\frac{1}{n}A_n + \frac{1}{n}B_n^\top X_t + y_t^{(n)}\right)^2 \\ \text{s.t. }\\ & A_{n+1} = A_n + B_n^\top(\mu - \Sigma\lambda_0) + \frac{1}{2}B_n^\top\Sigma\Sigma^\top B_n, & n=1,\dots,16 \\ & B_{n+1} = (\Phi - \Sigma\lambda_1)^\top B_n - \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}, & n=1,\dots,16 \\ & A_1 = 0, \qquad B_1 = -\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}\\ \end{aligned} where $B_n$ is $3\times 1$, $A_n$ is a scalar and $\Phi,\mu, \Sigma,y_t^{(n)}, X_t, \;t=1,\dots,T$ are given. $\Phi,\Sigma$ are $3\times3$ and $\mu, X_t$ are $3\times1$.
Unknown variables are $\lambda_0$ which is $3\times1$ and $\lambda_1$ which is $3\times 3$.
I'm familiar with Matlab, Matematica, R. Which software can I use? Which functions? How do I program it, a Lagrangian with a many constraints? Is there other method of solving such problems?
If you already use MATLAB and the problem is indeed convex (haven't checked in detail) you could try CVX.