SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentiation.multivariate
Class Hessian

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl<T>
      extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl<SymmetricMatrix>
          extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
              extended by com.numericalmethod.suanshu.analysis.differentiation.multivariate.Hessian
All Implemented Interfaces:
DeepCopyable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Matrix, MatrixAccessor, MatrixRing, Densifiable, MatrixDimension

public class Hessian
extends SymmetricMatrix

The Hessian matrix is the square matrix of the second-order partial derivatives of a multivariate function.

Mathematically, the Hessian of a scalar function is an n x n matrix, where n is the domain dimension of f.

      | ∂f         ∂f   |
      |----, ..., ----  |
      |∂x21       ∂x1∂xn |
 H =  |                 |
      |                 |
      | ∂f         ∂f   |
      |----, ..., ----  |
      |∂xn∂x1     ∂x2∂xn |
 

The Hessian matrix is computed numerically using the finite difference method.

We assume that the function f is continuous so the Hessian matrix is square and symmetric.

See Also:
FiniteDifference, Wikipedia: Hessian matrix

Field Summary
 
Fields inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
dim
 
Constructor Summary
Hessian(RealScalarFunction f, double... x)
          Construct a Hessian matrix for a multivariate function f at point x.
 
Method Summary
 double discriminant()
          Compute the determinant of the Hessian at x, which is called the discriminant.
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.triangle.SymmetricMatrix
add, deepCopy, equals, get, getColumn, getRow, hashCode, minus, ONE, scaled, set, t, toDense, toString, ZERO
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl
getMatrixData, setMatrixData
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl
add, call, getSample, minus, multiply, multiply, nCols, nRows, opposite, setColumn, setColumn, setRow, setRow
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hessian

public Hessian(RealScalarFunction f,
               double... x)
Construct a Hessian matrix for a multivariate function f at point x.

Parameters:
f - a multivariate function
x - the point to evaluate the Hessian of f at
Method Detail

discriminant

public double discriminant()
Compute the determinant of the Hessian at x, which is called the discriminant.

Returns:
the discriminant

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.