Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void ExpEval(TVec B, TVec X, TVec YHat) | Evaluates exponential function (fully vecctorized version). |
| 2 | void ExpEval(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 | Double ExpEval(Double[] B, Double X) | Evaluates exponential function. |
Overload 1: void ExpEval(TVec B, TVec X, TVec YHat)
Evaluates exponential function (fully vecctorized version).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | TVec | source TVec |
| 2 | X | TVec | source TVec |
| 3 | YHat | TVec | source TVec |
Result: stored in self (calling object)
Overload 2: void ExpEval(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.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | Double[] | |
| 2 | X | TVec | source TVec |
| 3 | YHat | TVec | source TVec |
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
using Dew.Math;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example(Steema.TeeChart.Styles.Line line1)
{
Vector X = new Vector(100);
Vector Y = new Vector(0);
X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05
// Y = b[0] + b[1]*X
RegModels.ExpEval(new double[] {1,3},X,Y);
MtxVecTee.DrawValues(X,Y,line1,false);
}
}
See Also: RegModels.ExpDeriv, RegModels.ExpFit
Overload 3: Double ExpEval(Double[] B, Double X)
Evaluates exponential function.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | Double[] | |
| 2 | X | Double | scalar |
Returns: Double - b[0]*Exp(b[1]*X) for given value X and parameters in B array.
Examples
using Dew.Math;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
double y = RegModels.ExpEval(new double[] {3.0, -0.5}, 1.5);
// y = 3*Exp(-0.5*1.5) = 1.4170996582
}
}