Definitions
- Symmetric matrices and quadratic functions
- Second-order approximation of non-linear functions
- Special symmetric matrices
Symmetric matrices and quadratic functions
Symmetric matrices
A square matrix is symmetric if it is equal to its transpose. That is,
![Rendered by QuickLaTeX.com A_{ij} = A_{ji}, \quad 1 \leq i,j \leq n.](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-1cba17e0deecc71a52daed2a39a48ae4_l3.png)
The set of symmetric matrices is denoted
. This set is a subspace of
.
Examples:
- A
example.
- Representation of a weighted, undirected graph.
- Laplacian matrix of a graph.
- Hessian of a function.
- Gram matrix of data points.
Quadratic functions
A function is said to be a quadratic function if it can be expressed as
![Rendered by QuickLaTeX.com q(x) = \sum\limits_{i=1}^n \sum\limits_{j=1}^n A_{ij}x_ix_j+2\sum\limits_{i=1}^n b_ix_i+c,](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-3519a6c1e23a10fa3e5307c242eff7da_l3.png)
for numbers ,
, and
,
. A quadratic function is thus an affine combination of the
‘s and all the ‘‘cross-products’’
. We observe that the coefficient of
is
.
The function is said to be a quadratic form if there are no linear or constant terms in it: ,
.
Note that the Hessian (matrix of second-derivatives) of a quadratic function is constant.
Examples:
Link between quadratic functions and symmetric matrices
There is a natural relationship between symmetric matrices and quadratic functions. Indeed, any quadratic function can be written as
![Rendered by QuickLaTeX.com q(x)=\left(\begin{array}{c} x \\ 1 \end{array}\right)^T\left(\begin{array}{cc} A & b \\ b^T & c \end{array}\right)\left(\begin{array}{c} x \\ 1 \end{array}\right)=x^T A x+2 b^T x+c,](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-3d43dc765ac28d11c5a5304d19ca5960_l3.png)
for an appropriate symmetric matrix , vector
and scalar
. Here,
is the coefficient of
in
; for
,
is the coefficient of the term
in
;
is that of
; and
is the constant term,
. If
is a quadratic form, then
,
, and we can write
where now
.
Examples:
Second-order approximations of non-quadratic functions
We have seen how linear functions arise when one seeks a simple, linear approximation to a more complicated non-linear function. Likewise, quadratic functions arise naturally when one seeks to approximate a given non-quadratic function by a quadratic one.
One-dimensional case
If is a twice-differentiable function of a single variable, then the second-order approximation (or, second-order Taylor expansion) of
at a point
is of the form
![Rendered by QuickLaTeX.com f(x) \approx q(x) = f(x_0)+f'(x_0)(x-x_0)+\frac{1}{2}f''(x_0)(x-x_0)^2,](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-e9a04604fcd165eabfac5c690917f26c_l3.png)
where is the first derivative, and
the second derivative, of
at
. We observe that the quadratic approximation
has the same value, derivative, and second-derivative as
, at
.
![]() |
Example: The figure shows a second-order approximation ![]() ![]() ![]() at the point |
Multi-dimensional case
In multiple dimensions, we have a similar result. Let us approximate a twice-differentiable function by a quadratic function
, so that
and
coincide up and including to the second derivatives.
The function must be of the form
![Rendered by QuickLaTeX.com q(x) = x^TAx+2b^Tx+c,](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-d09659000267912cec9253c6fc736c2d_l3.png)
where ,
, and
. Our condition that
coincides with
up and including to the second derivatives shows that we must have
![Rendered by QuickLaTeX.com \nabla^2 q(x)=2A=\nabla^2 f(x_0),\quad \nabla q(x) = 2(Ax_0+b) = \nabla f(x_0), \quad x^TAx_0+2b^Tx_0 + c = f(x_0),](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-34356b4eaae25f92c7004aca84e8e068_l3.png)
where is the Hessian, and
the gradient, of
at
.
Solving for we obtain the following result:
Second-order expansion of a function. The second-order approximation of a twice-differentiable function at a point
is of the form
![Rendered by QuickLaTeX.com f(x) \approx q(x) = f(x_0)+\nabla f(x_0)^T(x-x_0)+\frac{1}{2}(x-x_0)^T\nabla^2 f(x_0)(x-x_0),](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-1357a138115e6bdec222212cf34e74a9_l3.png)
where is the gradient of
at
, and the symmetric matrix
is the Hessian of
at
.
Example: Second-order expansion of the log-sum-exp function.
Special symmetric matrices
Diagonal matrices
Perhaps the simplest special case of symmetric matrices is the class of diagonal matrices, which are non-zero only on their diagonal.
If , we denote by
, or
for short, the
(symmetric) diagonal matrix with
on its diagonal. Diagonal matrices correspond to quadratic functions of the form
![Rendered by QuickLaTeX.com q(x) = \sum\limits_{x=1}^n \lambda_i x_i^2 = x^T{\bf diag}(\lambda)x.](https://ecampusontario.pressbooks.pub/app/uploads/quicklatex/quicklatex.com-0387297dd99aabfedb90431a313070a9_l3.png)
Such functions do not have any ‘‘cross-terms’’ of the form with
.
Example: A diagonal matrix and its associated quadratic form.
Symmetric dyads
Another important class of symmetric matrices is that of the form , where
. The matrix has elements
and is symmetric. Such matrices are called symmetric dyads. (If
, then the dyad is said to be normalized.)
Symmetric dyads correspond to quadratic functions that are simply squared linear forms: .
Example: A squared linear form.