Class WengertJacobian

java.lang.Object
org.drip.numerical.differentiation.WengertJacobian

public class WengertJacobian
extends java.lang.Object
WengertJacobian contains the Jacobian of the given set of Wengert variables to the set of parameters. It exposes the following functionality:

  • Set/Retrieve the Wengert variables
  • Accumulate the Partials
  • Scale the partial entries
  • Merge the Jacobian with another
  • Retrieve the WengertJacobian elements
  • Display the contents of the WengertJacobian




Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    WengertJacobian​(int iNumWengerts, int iNumParameters)
    WengertJacobian constructor
  • Method Summary

    Modifier and Type Method Description
    boolean accumulatePartialFirstDerivative​(int iWengertIndex, int iParameterIndex, double dblDWengertDParameter)
    Accumulate {D(Wengert)}/{D(Parameter)}
    boolean cumulativeMerge​(WengertJacobian wjOther)
    Accumulate and merge partial entries from the other CurveWengertJacobian
    boolean cumulativeMerge​(WengertJacobian wjOther, double dblWeight)
    Accumulate and merge the weighted partial entries from the other CurveWengertJacobian
    java.lang.String displayString()
    Stringifies the contents of WengertJacobian
    double firstDerivative​(int iWengertIndex, int iParameterIndex)
    Retrieve {D(Wengert)}/{D(Parameter)} for the Wengert and the parameter identified by their indices
    int numParameters()
    Retrieve the number of Parameters
    int numWengerts()
    Retrieve the number of Wengert Variables
    boolean scale​(double dblScale)
    Scale the partial entries
    boolean setWengert​(int iWengertIndex, double dblWengert)
    Set the Value for the Wengert variable
    double wengert​(int iIndex)
    Get the Value for the Wengert Variable

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WengertJacobian

      public WengertJacobian​(int iNumWengerts, int iNumParameters) throws java.lang.Exception
      WengertJacobian constructor
      Parameters:
      iNumWengerts - Number of Wengert variables
      iNumParameters - Number of Parameters
      Throws:
      java.lang.Exception - Thrown if the inputs are invalid
  • Method Details

    • numWengerts

      public int numWengerts()
      Retrieve the number of Wengert Variables
      Returns:
      Number of Wengert Variables
    • numParameters

      public int numParameters()
      Retrieve the number of Parameters
      Returns:
      Number of Parameters
    • setWengert

      public boolean setWengert​(int iWengertIndex, double dblWengert)
      Set the Value for the Wengert variable
      Parameters:
      iWengertIndex - Wengert Variable Index
      dblWengert - The Value for the Wengert Variable
      Returns:
      TRUE - Successfully set
    • wengert

      public double wengert​(int iIndex) throws java.lang.Exception
      Get the Value for the Wengert Variable
      Parameters:
      iIndex - Wengert Variable Index
      Returns:
      The Value for the Wengert variable
      Throws:
      java.lang.Exception - Thrown if the inputs are invalid
    • accumulatePartialFirstDerivative

      public boolean accumulatePartialFirstDerivative​(int iWengertIndex, int iParameterIndex, double dblDWengertDParameter)
      Accumulate {D(Wengert)}/{D(Parameter)}
      Parameters:
      iWengertIndex - Wengert Variable Index
      iParameterIndex - Parameter Index
      dblDWengertDParameter - The incremental {D(Wengert)}/{D(Parameter)}
      Returns:
      TRUE - Successfully set
    • firstDerivative

      public double firstDerivative​(int iWengertIndex, int iParameterIndex)
      Retrieve {D(Wengert)}/{D(Parameter)} for the Wengert and the parameter identified by their indices
      Parameters:
      iWengertIndex - Wengert Variable Index
      iParameterIndex - Parameter Index
      Returns:
      {D(Wengert)}/{D(Parameter)}
    • cumulativeMerge

      public boolean cumulativeMerge​(WengertJacobian wjOther)
      Accumulate and merge partial entries from the other CurveWengertJacobian
      Parameters:
      wjOther - CurveWengertJacobian to be accumulated and merged
      Returns:
      TRUE - Successfully accumulated and merged
    • cumulativeMerge

      public boolean cumulativeMerge​(WengertJacobian wjOther, double dblWeight)
      Accumulate and merge the weighted partial entries from the other CurveWengertJacobian
      Parameters:
      wjOther - CurveWengertJacobian to be accumulated and merged
      dblWeight - The Weight
      Returns:
      TRUE - Successfully accumulated and merged
    • scale

      public boolean scale​(double dblScale)
      Scale the partial entries
      Parameters:
      dblScale - Factor by which the partials are to be scaled by
      Returns:
      TRUE - Scaling down successful
    • displayString

      public java.lang.String displayString()
      Stringifies the contents of WengertJacobian
      Returns:
      Stringified WengertJacobian