Completing squares - matrices

1k Views Asked by At

I am familiar with completing squares in R and I am familiar with matrix-equations - but I dont have an idea, how to do completing squares with matrices.

$\frac{1}{2}X^TCX+b^TX+A$

The solution is

$\frac{1}{2}(X-(-C^{-1} b)^TM(X-(-C^{-1} b) + A - 1/2b^TC^{-1}b$

My idea is:

1 step: factor out 1/2

2 step: vector $\frac{b^T}{2}$ --> $(X-\frac{b^T}{2})^TM(X-\frac{b^T}{2})$

But this is completely wrong :/

1

There are 1 best solutions below

0
On

I am not completely sure about your notation, but let's assume that $X$ and $b$ are vectors and $A$ is a scalar. Also, let's assume that $C$ is a symmetric matrix (since it appears in an expression $x^T C x$ so that the antisymmetric part does not contribute). Then one can write the desired form of the expression as

$$(x-x_0)^TM(x-x_0)+\alpha=x^TMx-2x_0^TMx+x_0^TMx_0+\alpha$$

Now, comparison term by term yields $M=\frac{1}{2}C$, $-2Mx_0=b$, and $x_0^TMx_0+\alpha=A$. Thus $x_0=-C^{-1}b$ and $\alpha=A-\frac{1}{2}b^TC^{-1}b$.