Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double ExpEval(const DewArray<double> &B, double X); | Evaluates exponential function. |
| 2 | void ExpEval(const DewArray<double> &B, TVec *X, TVec *YHat); | Evaluates b[0]*Exp(b[1]*X) for given values in X vector, parameters in B array, and returns the results in XHat vector. |
| 3 | void ExpEval(TVec *B, TVec *X, TVec *YHat); | Evaluates exponential function (fully vecctorized version). |
Overload 1: double ExpEval(const DewArray<double> &B, double X);
Evaluates exponential function.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | const DewArray<double> & | |
| 2 | X | double |
Returns: b[0]*Exp(b[1]*X) for given value X and parameters in B array.
Examples
#include "Units.RegModels.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::RegModels;
void Example()
{
double y = ExpEval(DewArray<double>{3.0, -0.5}, 1.5);
// y = 3*Exp(-0.5*1.5) = 1.4170996582
}
Declared in Dew::Stats::Units::RegModels · Dew.Stats/Units.RegModels.h · Cross-compiler
Overload 2: void ExpEval(const DewArray<double> &B, TVec *X, TVec *YHat);
Evaluates b[0]*Exp(b[1]*X) for given values in X vector, parameters in B array, and returns the results in XHat vector.
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
#include "MtxExpr.h"
#include "Units.RegModels.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::RegModels;
void Example()
{
Vector X(100);
Vector Y(0);
X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05
// Y = b[0]*Exp(b[1]*X)
ExpEval(DewArray<double>{1,3},X,Y);
}
See Also: RegModels::ExpDeriv, RegModels::ExpFit
Declared in Dew::Stats::Units::RegModels · Dew.Stats/Units.RegModels.h · Cross-compiler