Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double StdDev(); | Standard deviation. |
| 2 | double StdDev(int Index, int Len); | Returns the standard deviation of calling object elements [Index]..[Index+Len-1]. |
| 3 | TCplx StdDev(const TCplx &AMean); | Returns the standard deviation of all calling object complex elements. |
| 4 | TCplx StdDev(const TCplx &AMean, int Index, int Len); | Returns the standard deviation of calling object complex elements [Index]..[Index+Len-1]. |
| 5 | double StdDev(const double AMean); | Returns the standard deviation of all calling object elements. |
| 6 | double StdDev(const double AMean, int Index, int Len); | Returns the standard deviation of calling object elements [Index]..[Index+Len-1]. |
Overload 1: double StdDev();
Standard deviation.
Calculate the standard deviation of all calling object elements. The result is a real value. An exception is raised if calling vector TSparseMtx::Complex property is true.
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TVec* a;
CreateIt(a);
a->SetIt(false, DewArray<double>{-1,2,-3,4});
double amean = a->Mean();
double c = a->StdDev(amean);
// alternative ... c = a.StdDev();
FreeIt(a);
}
#include "MtxExpr.h"
#include "Units.Math387.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
void Example()
{
Vector a;
a.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
double result = a.StdDev();
if (Abs(result - 1.29099444873581) > 1e-10)
throw tException(DewString("Vector.StdDev: expected 1.29099444873581, got ") + SampleToStr(result));
}
Overload 2: double StdDev(int Index, int Len);
Returns the standard deviation of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | int | |
| 2 | Len | int |
An exception is raised if calling object TSparseMtx::Complex property is true or if array borders are overrun/underrun.
Overload 3: TCplx StdDev(const TCplx &AMean);
Returns the standard deviation of all calling object complex elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AMean | const TCplx & |
The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object TSparseMtx::Complex property is false.
Overload 4: TCplx StdDev(const TCplx &AMean, int Index, int Len);
Returns the standard deviation of calling object complex elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AMean | const TCplx & | |
| 2 | Index | int | |
| 3 | Len | int |
The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object TSparseMtx::Complex property is false or if array borders are overrun/underrun.
Overload 5: double StdDev(const double AMean);
Returns the standard deviation of all calling object elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AMean | const double |
The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object TSparseMtx::Complex property is true.
Overload 6: double StdDev(const double AMean, int Index, int Len);
Returns the standard deviation of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AMean | const double | |
| 2 | Index | int | |
| 3 | Len | int |
The average of the coresponding elements must be passed as a parameter. An exception is raised if calling object TSparseMtx::Complex property is true or if array borders are overrun/underrun.