Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double PowerEval(const DewArray<double> &B, double X); | Evaluates power function. |
| 2 | void PowerEval(const DewArray<double> &B, TVec *X, TVec *YHat); | Evaluates b[0]*X^b[1] for given values in X vector, parameters in B array, and returns the results in XHat vector. |
| 3 | void PowerEval(TVec *B, TVec *X, TVec *YHat); | Evaluate power function model (vectorized version). |
Overload 1: double PowerEval(const DewArray<double> &B, double X);
Evaluates power function.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | const DewArray<double> & | |
| 2 | X | double |
Returns: b[0]*X^b[1] 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 = PowerEval(DewArray<double>{-5,3.5},2.0);
}
Declared in Dew::Stats::Units::RegModels · Dew.Stats/Units.RegModels.h · Cross-compiler
Overload 2: void PowerEval(const DewArray<double> &B, TVec *X, TVec *YHat);
Evaluates b[0]*X^b[1] 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 power 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,false);
Vector Y(0);
X.Ramp(-5.0, 0.1);
PowerEval(DewArray<double>{1.0, 3.0}, X, Y);
}
See Also: RegModels::PowerDeriv, RegModels::PowerFit
Declared in Dew::Stats::Units::RegModels · Dew.Stats/Units.RegModels.h · Cross-compiler