Find best fitting symmetric positive definite Matrix

84 Views Asked by At

Let $x_i, y_i \in \mathbb{R}^3$ be vectors with $i = 1,\ldots,n$ and $n\geq 3$. Find the best fitting Matrix $A \in \mathbb{R}^{3 \times 3}$:

\begin{align} &\min_A \sum_{i=1}^n ||Ax_i - y_i||^2\\ \text{s.t. } &A = A^T \text{ and } x^T A x \geq 0 \end{align}

I know so far that a solution for the minimazation problem without the constraint can be found by using the pseudo-inverse i.e.

$A = YX^T(X X^T)^{-1}$ where the $i$th-column of the matrices $X, Y \in \mathbb{R}^{3\times n}$ are given by $x_i, y_i$.

Does anyone know how to include the constraint into the minimazation problem?

Edit: Using the suggestion $A=G^TG$ and plugging into the optimazation problem, one reads:

\begin{align} &\min_A \sum_{i=1}^n ||G^TGx_i - y_i||^2\\ \end{align}

Taking a look at the norm, we can calculate: $$ \sum_{i=1}^n ||G^TG x_i - y_i||^2 = \sum_{i=1}^n (G^TG x_i - y_i)^T (G^TG x_i - y_i) = \sum_{i=1}^n(x_i^TG^TG - y_i^T)(G^TG x_i-y_i) = \sum_{i=1}^n (x_i^T (G^TG)^2 x_i - 2 y_i^TG^TGx_i + y_i^Ty_i) $$

Now calculating the gradients for $(x_i^T (G^TG)^2x_i - 2 y_i^TG^TGx_i + y_i^Ty_i) = 0$:

  • $\nabla_G \, x_i^T (G^TG)^2x_i = 2 x_i^T G^TGx_i Gx_i x_i^T$ (I am not sure about this one though)

  • $\nabla_G \, -2 y_i^TG^TGx_i= -2G(y_ix_i^T + x_iy_i^T)$

  • $\nabla_G \, y_i^Ty_i = 0$.