Click or drag to resize

DoubleParameterizedFunctionGradientWithRespectToParams Method

Method for calculating the gradient with respect to the parameters while keeping x fixed at the specified value.

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.4
Syntax
public virtual void GradientWithRespectToParams(
	DoubleVector parameters,
	double x,
	ref DoubleVector grad
)

Parameters

parameters
Type: CenterSpace.NMath.CoreDoubleVector
The gradient with respect to the parameters will be evaluated at this point.
x
Type: SystemDouble
The point to fix x to.
grad
Type: CenterSpace.NMath.CoreDoubleVector
On entry a vector of the correct size (same as the number of parameters). On exit contains the values of the gradient.
Exceptions
ExceptionCondition
InvalidArgumentExceptionThrown if the length of the input gradient vector is not equal to the length of the vector of parameter values.
Remarks
For example, if f(x: a, b) = a*cos(b*x) + b*sin(a*x) is a function parameterized on a and b, then for a fixed value of x we can think of f as being a function of a and b. We can then take the partial derivatives of f with respect to a and b to form the gradient with respect to the parameters: grad(a,b) = { fa(a,b), fb(a,b) } = { cos(b*x) + b*x*cos(a*x), -x*a*sin(b*x) + sin(a*x) }.
See Also