9 Quadratic From
A quadratic form is a type of polynomial expression that is a sum of terms where each term is either a variable squared or the product of two variables, often associated with a symmetric matrix. Quadratic forms are useful in various areas of mathematics, physics, statistics, and optimization.
9.1 Definition of Quadratic Form
A quadratic form is a type of mathematical expression that can be written as a sum of terms, each of which involves the product of a variable with itself (squared terms) or with another variable (cross terms). In general, a quadratic form is a homogeneous polynomial of degree 2 in a set of variables.
9.1.1 2D Quadratic Form
Let the vector and symmetric matrix in 2D be defined as follows:
The quadratic form is expressed as:
Expanding this expression gives:
The resulting quadratic form is:
9.1.2 3D Quadratic Form
For 3D, the vector and symmetric matrix are defined as follows:
The quadratic form in this case is expressed as:
Expanding it gives:
The expanded quadratic form is:
9.1.3 nD Quadratic Form
In
The quadratic form is expressed as:
Steps to Calculate a Quadratic Form:
Compute the transpose of
:
First, express as a column vector of variables:
The transpose of , denoted as , is:Multiply
with the matrix :
Multiply the row vector by the symmetric matrix :
This produces a row vector:Multiply the result by
:
Multiply the resulting row vector by the column vector :
This produces the final quadratic form expression.Final Expression:
In summation form:
Separating diagonal and off-diagonal terms:
Or, in fully expanded form:
Key Insights:
- The diagonal terms
correspond to the squared variables . - The off-diagonal terms
(where ) represent the cross terms .
9.2 Key Concepts
Symmetry of the Matrix
:
The matrix must be symmetric, meaning that . This symmetry ensures that the quadratic form only contains real coefficients and simplifies the expression of the form.Diagonal and Off-Diagonal Terms:
The quadratic form contains two types of terms:- Diagonal terms (
), which represent the squared terms of the variables . - Off-diagonal terms (
, for ), which correspond to the interactions between different variables and (cross terms like ).
- Diagonal terms (
Scalar Output:
The result of applying the quadratic form to the vector is a scalar, i.e., a single numerical value.
9.3 Geometric Interpretation of Quadratic Forms
In the context of quadratic forms, the matrix
9.3.1 Ellipsoid
If
9.3.2 Hyperboloid
If
- A one-sheeted hyperboloid, if there’s a pair of positive and negative eigenvalues.A one-sheeted hyperboloid can be described with the equation:
A hyperboloid is an open surface, unlike the ellipsoid. Let consider the following one-sheeted hyperboloid visualization:
9.3.3 Paraboloid
A paraboloid arises when the quadratic form has a special structure, often reflecting a situation where the matrix
- An elliptic paraboloid can be described with the equation:
This involves using a positive definite matrix for the elliptic paraboloid.
- A hyperbolic paraboloid can be described with the equation:
The type of surface described by a quadratic form is determined by the positive, negative, or zero nature of the eigenvalues of the matrix
9.4 Applications of Quadratic Forms
Quadratic forms are essential in various disciplines:
- Optimization: In finding the minimum or maximum of a function, especially quadratic functions in constrained optimization problems.
- Statistics: In the context of variance-covariance matrices and regression analysis.
- Physics and Engineering: For representing the energy of a system or describing various physical systems.
- Machine Learning: In algorithms like Support Vector Machines (SVM) and in kernel methods where the quadratic form is used to map data into higher-dimensional spaces.
9.5 Simple Implementation in Python
Below is a Python implementation of a quadratic form:
import numpy as np
# Define values for x1 and x2
= 1, 2 # Example
x1, x2
# Matrix Q and vector x
= np.array([[2, 2],
Q 2, 3]])
[= np.array([[x1], [x2]])
x
# Compute the quadratic form
= np.dot(x.T, np.dot(Q, x))
Q_x print("Quadratic Form Q(x):", Q_x)
Quadratic Form Q(x): [[22]]