TVec::StdDev Method

Overload List

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

Remarks:

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

Examples
#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));
}
See Also: TVec::Mean
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1Indexint
2Lenint
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 3: TCplx StdDev(const TCplx &AMean);

Returns the standard deviation of all calling object complex elements.

#NameTypeDescription
1AMeanconst TCplx &
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1AMeanconst TCplx &
2Indexint
3Lenint
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 5: double StdDev(const double AMean);

Returns the standard deviation of all calling object elements.

#NameTypeDescription
1AMeanconst double
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

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

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

#NameTypeDescription
1AMeanconst double
2Indexint
3Lenint
Remarks:

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

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler