# least squared optimization

I want to decompose a list of 3D vectors $$X_j$$ as linear combination of five 3D verctors $$C_k$$

$$X_j= \sum_{i=1}^{5}{w_{ji}C_i}$$ both $$X_j$$ and $$C_i$$ are 3 components vectors

$$C= \begin{bmatrix} C_{11} & C_{12} & C_{13} \\ C_{21} & C_{22} & C_{23} \\ ... \\ \\ C_{51} & C_{52} & C_{53} \end{bmatrix}$$

$$W= \begin{bmatrix} W_{11} & W_{12} &... & W_{15} \\ W_{21} & W_{22} &... & W_{25} \\ ... \\ \\ W_{m1} & W_{m2} &... & W_{m5} \end{bmatrix}$$

$$X= \begin{bmatrix} X_{11} & X_{12} & X_{13} \\ X_{21} & X_{22} & X_{23} \\ ... \\ \\ X_{m1} & X_{m2} & X_{n3} \end{bmatrix}$$ i think this is a least squared optimization problem, but i am unable to correctly formulate it in the standard form $$\left \|b-Ax \right \|^2$$ and implement it in cvxpy.

$$\left \| X_j- \sum_{i=1}^{5}{w_{ji}C_i} \right \|^2$$

• $W$ is the unknown here, correct? We assume $X$ and $C$ are fixed, right? – spektr Jul 15 '19 at 14:24
• Yes $W$ is unknown and $X$ and $C$ are are fixed. – Abdessettar Ghemougui Jul 15 '19 at 14:45
• Why implement in CVXPY if there's a closed form solution? – Rodrigo de Azevedo Jul 16 '19 at 20:13
• what is the colosed form solution for this problem ? – Abdessettar Ghemougui Jul 26 '19 at 15:27