TMultiDeriveProc Delegate

Source: Regress.cs · Assembly: Dew.Stats
MulticastDelegateTMultiDeriveProc

public delegate TMultiDeriveProc

Defines derivatives of a function.

The type describes the procedure for calculating the derivatives of a regression function TMultiRegressFun with respect to the regression parameters (B array), evaluated at (X,Y). The function accepts all pairs of (x,y) values at which the function is to be evaluted allowing for vectorized (up to 20x faster) computation. Each independent variable X is stored as a separate vector in the list x. The result is returned in to the parameter Grad. The "const" modifier of "Grad" applies to the pointer and not to the contents of object.

Examples

csharp
private void SimplexParabolaDeriv(Dew.Stats.TMultiRegresFun RegressFun, TVecList x, TVec y, TVec Pars, TVecList Grad)
{
    Grad[0].Sqr(x[0]);    //  Grad.Values[0] = x*x;
    Grad[1].Copy(x[0]);   //  Grad.Values[1] = x;

    Grad[2].Size(x[0]);
    Grad[2].SetVal(1);    //  Grad.Values[2] = 1.0;
}