Class MultiDimensionalTaylorDegree2

java.lang.Object
edu.cmu.tetrad.util.MultiDimensionalTaylorDegree2

public class MultiDimensionalTaylorDegree2 extends Object
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

    Constructors
    Constructor
    Description
    MultiDimensionalTaylorDegree2(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 Type
    Method
    Description
    double
    evaluate(double[] x)
    Evaluates a second-degree Taylor series expansion at a given point.
    static void
    main(String[] args)
    The main method demonstrates the use of the MultiDimensionalTaylorDegree2 class to evaluate a second-degree Taylor series expansion at a specific point.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static void main(String[] args)
      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.