You are here: Symbol Reference > RegModels Namespace > Functions > RegModels.ExpEval Function
Stats Master VCL
ContentsIndex
PreviousUpNext
RegModels.ExpEval Function

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

Pascal
procedure ExpEval(Const B: Array of double; const X: TVec; const YHat: TVec); overload;

Size and Complex properties of XHat vector are adjusted automatically.

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.

Evaluate exponential function for multiple values at the same time.

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;
#include "Math387.hpp"
#include "RegModels.hpp"
#include "MtxExpr.hpp"
void __fastcall Example(TLineSeries* Series1);
{
  sVector X,Y;
  X.Size(100,false);
  X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05
  ExpEval(OPENARRAY(double,(3.0, -0.5)),X,Y);
  DrawValues(X,Y,Series1,false);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!