RegModels.ExpEval Method

Overload List

#SignatureDescription
1procedure ExpEval(const B: TVec; const X: TVec; const YHat: TVec);Evaluates exponential function (fully vecctorized version).
2procedure ExpEval(const B: TDoubleArray; const X: TVec; const YHat: TVec);Evaluates b[0]*Exp(b[1]*X) for given values in X vector, parameters in B array, and returns the results in XHat vector.
3function ExpEval(const B: TDoubleArray; X: Double): Double;Evaluates exponential function.

Overload 1: procedure ExpEval(const B: TVec; const X: TVec; const YHat: TVec);

Evaluates exponential function (fully vecctorized version).

#NameTypeDescription
1BTVec
2XTVec
3YHatTVec

Result: stored in self (calling object)

Overload 2: procedure ExpEval(const B: TDoubleArray; const X: TVec; const YHat: TVec);

Evaluates b[0]*Exp(b[1]*X) for given values in X vector, parameters in B array, and returns the results in XHat vector.

#NameTypeDescription
1BTDoubleArray
2XTVec
3YHatTVec

Result: stored in self (calling object)

Remarks:

Size and Complex properties of XHat vector are adjusted automatically.

Note
Use this version if you want to evaluate exponential function for multiple values at the same time. This is a lot faster than calling single value version for each x value.

Examples
Uses MtxExpr, MtxVecTee, Series, RegModels;
procedure Example(Series1: TLineSeries);
var Y,X: Vector;
begin
    X.Size(100);
    X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05
    // Y = b[0] + b[1]*X
    ExpEval([1,3],X,Y);
    DrawValues(X,Y,Series1,false);
end;
See Also: RegModels.ExpDeriv, RegModels.ExpFit

Overload 3: function ExpEval(const B: TDoubleArray; X: Double): Double;

Evaluates exponential function.

#NameTypeDescription
1BTDoubleArray
2XDoublescalar

Returns: Double - b[0]*Exp(b[1]*X) for given value X and parameters in B array.

Examples
Uses Math387, RegModels;
var y: double;
begin
    y := ExpEval([3,-0.5], 1.5);
    // Res = 3*Exp(-0.5*1.5) = 1.4170996582
end;