FiniteDifferenceGradient

class FiniteDifferenceGradient(*args)

Base class for first order finite-difference schemes.

Available constructors:

FiniteDifferenceGradient(epsilon, evalImpl)

FiniteDifferenceGradient(step, evalImpl)

Parameters:
evalImplEvaluationImplementation

Implementation of the evaluation of a function.

epsilonfloat, sequence of float

Finite difference steps for each dimension.

stepFiniteDifferenceStep

Defines how finite difference steps values are computed.

Methods

getCallsNumber()

Accessor to the number of times the gradient has been called.

getClassName()

Accessor to the object's name.

getEpsilon()

Get the finite difference steps.

getEvaluation()

Get the implementation of the evaluation of the function.

getFiniteDifferenceStep()

Get the finite difference step.

getInputDimension()

Get the input dimension.

getMarginal(*args)

Accessor to the gradient implementation of a specific output.

getName()

Accessor to the object's name.

getOutputDimension()

Get the output dimension.

getParameter()

Accessor to the parameter values.

gradient(inP)

Get the gradient at some point.

hasName()

Test if the object is named.

isActualImplementation()

Accessor to the validity flag.

setFiniteDifferenceStep(finiteDifferenceStep)

Set the finite difference step.

setName(name)

Accessor to the object's name.

setParameter(parameter)

Accessor to the parameter values.

Notes

Base class to define first order finite-difference schemes. The gradient can be computed only through its derived classes:

__init__(*args)
getCallsNumber()

Accessor to the number of times the gradient has been called.

Returns:
calls_numberint

Integer that counts the number of times the gradient has been called since its creation.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getEpsilon()

Get the finite difference steps.

Returns:
epsilonPoint

Finite difference steps for each dimension.

getEvaluation()

Get the implementation of the evaluation of the function.

Returns:
evalImplEvaluationImplementation

Implementation of the evaluation of a function.

getFiniteDifferenceStep()

Get the finite difference step.

Returns:
stepFiniteDifferenceStep

Defines how finite difference steps values are computed.

getInputDimension()

Get the input dimension.

Returns:
dimensionint

Input dimension.

getMarginal(*args)

Accessor to the gradient implementation of a specific output.

Parameters:
iint

Integer corresponding to the output (Care: it starts at 0).

indicessequence of integer

The set of indices for which the outputs are extracted.

Returns:
gradientImplementationGradientImplementation

A gradient implementation restricted to its compenents functions which indices are i or indices.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOutputDimension()

Get the output dimension.

Returns:
dimensionint

Output dimension.

getParameter()

Accessor to the parameter values.

Returns:
parameterPoint

The parameter values.

gradient(inP)

Get the gradient at some point.

Parameters:
pointsequence of float

Point where the gradient is computed.

Returns:
gradientMatrix

Transposed Jacobian matrix evaluated at point.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

isActualImplementation()

Accessor to the validity flag.

Returns:
is_implbool

Whether the implementation is valid.

setFiniteDifferenceStep(finiteDifferenceStep)

Set the finite difference step.

Parameters:
stepFiniteDifferenceStep

Defines how finite difference steps values are computed.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setParameter(parameter)

Accessor to the parameter values.

Parameters:
parametersequence of float

The parameter values.

Examples using the class

Estimate moments from Taylor expansions

Estimate moments from Taylor expansions

Use the FORM - SORM algorithms

Use the FORM - SORM algorithms

Function manipulation

Function manipulation