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