Package edu.cmu.tetrad.util
Class MultiDimensionalTaylorDegree2
java.lang.Object
edu.cmu.tetrad.util.MultiDimensionalTaylorDegree2
Represents a multidimensional second-degree Taylor series approximation for a differentiable function. This class
provides functionality to construct the Taylor expansion based on input parameters such as the expansion point,
function value, gradient, and Hessian, and to evaluate it at a given point.
The Taylor series is represented as: f(x) â fA + Σ(âf/âx_i * (x_i - a_i)) + 1/2 ΣΣ(â²f/âx_iâx_j * (x_i - a_i) * (x_j - a_j))
-
Constructor Summary
ConstructorsConstructorDescriptionMultiDimensionalTaylorDegree2(double[] a, double fA, double[] gradient, double[][] hessian) Constructs a representation of a second-degree Taylor series expansion for a multi-dimensional function. -
Method Summary
Modifier and TypeMethodDescriptiondoubleevaluate(double[] x) Evaluates a second-degree Taylor series expansion at a given point.static voidThe main method demonstrates the use of the MultiDimensionalTaylorDegree2 class to evaluate a second-degree Taylor series expansion at a specific point.
-
Constructor Details
-
MultiDimensionalTaylorDegree2
public MultiDimensionalTaylorDegree2(double[] a, double fA, double[] gradient, double[][] hessian) Constructs a representation of a second-degree Taylor series expansion for a multi-dimensional function.- Parameters:
a- the expansion point. It is an array representing the coordinates of the point at which the Taylor expansion is centered.fA- the value of the function at the expansion point.gradient- the gradient vector of the function at the expansion point. Each element represents the partial derivative with respect to a variable.hessian- the Hessian matrix of the function at the expansion point. This is a 2D array where each element at position (i, j) represents the second partial derivative with respect to the ith and jth variables.
-
-
Method Details
-
main
The main method demonstrates the use of the MultiDimensionalTaylorDegree2 class to evaluate a second-degree Taylor series expansion at a specific point.- Parameters:
args- command-line arguments passed to the program
-
evaluate
public double evaluate(double[] x) Evaluates a second-degree Taylor series expansion at a given point.- Parameters:
x- the point at which the Taylor series is evaluated. It is an array where each element represents a variable's value.- Returns:
- the value of the Taylor series expansion at the specified point.
-