Vector::StdDev Method

Overload List

#SignatureDescription
1double StdDev() const;Standard deviation.
2double StdDev(int Index, int Len) const;Returns the standard deviation of calling object elements [Index]..[Index+Len-1].
3TCplx StdDev(TCplx AMean) const;Returns the standard deviation of all calling object complex elements.
4TCplx StdDev(TCplx AMean, int Index, int Len) const;Returns the standard deviation of calling object complex elements [Index]..[Index+Len-1].
5double StdDev(double AMean) const;Returns the standard deviation of all calling object elements.
6double 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.

Remarks:

Calculate the standard deviation of all calling object elements. The result is a real value. An exception is raised if calling vector Vector::Complex property is true.

Examples
#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));
}
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a;
    double c;
    double aMean;

    a.SetIt(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.
}
See Also: Vector::Mean
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: double StdDev(int Index, int Len) const;

Returns the standard deviation of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexint
2Lenint
Remarks:

An exception is raised if calling object Vector::Complex property is true or if array borders are overrun/underrun.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector 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.
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 3: TCplx StdDev(TCplx AMean) const;

Returns the standard deviation of all calling object complex elements.

#NameTypeDescription
1AMeanTCplx
Remarks:

The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object Vector::Complex property is false.

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 4: TCplx StdDev(TCplx AMean, int Index, int Len) const;

Returns the standard deviation of calling object complex elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMeanTCplx
2Indexint
3Lenint
Remarks:

The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object Vector::Complex property is false or if array borders are overrun/underrun.

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 5: double StdDev(double AMean) const;

Returns the standard deviation of all calling object elements.

#NameTypeDescription
1AMeandouble
Remarks:

The average of all calling object elements must be passed as a AMean parameter. An exception is raised if calling object Vector::Complex property is true.

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 6: double StdDev(double AMean, int Index, int Len) const;

Returns the standard deviation of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMeandouble
2Indexint
3Lenint
Remarks:

The average of the coresponding elements must be passed as a parameter. An exception is raised if calling object Vector::Complex property is true or if array borders are overrun/underrun.

Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler