What does this formula ('matrix notation') mean?

51 Views Asked by At

Suppose I want to rewrite a function $f$ of two variables in matrix notation

$$f(\textbf{z})=a + \textbf{d}^{T}\textbf{z} + \frac{1}{2}\textbf{z}^{T} H \textbf{z}$$

I know $H$ stands for the Hessian matrix, and I know that $a$ is a constant and $\textbf{z}$, $\textbf{d}$ are vectors, but what do they mean?

Example function (for simplicity):

$$f(x,y)=-5x^{2} + 7xy + 8y - 10$$

1

There are 1 best solutions below

1
On BEST ANSWER

It is really just a different form of writing $f$. It is called a quadratic form. We can write $f(x,y)$ that you gave in the question as

$$f(x,y) = -10 + [0,8] \begin{bmatrix} x \\ y \end{bmatrix}+[x,y] \begin{bmatrix} -5 & 3.5 \\ 3.5 & 0 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} $$

Basically we have a quadratic and want to write it in this way. The constant $a$ is the constant term. The ${d}$ vector holds the coefficients for the linear terms. The matrix $H$ holds the coefficients for the $x^2$ and $y^2$ terms in the upper left and lower right entries and the sum of the remaining entries should be the coefficient of the mixed $xy$ term. So there is some freedom here, but typically I choose the entries such that the matrix is symmetric. Maybe after you do a few examples you will see more easily how to write a function in this form.