TSparseMtx.StdDev Method

Overload List

#SignatureDescription
1function StdDev: Double;Standard deviation.
└ indexed: function StdDev(Index: Integer; Len: Integer): Double;
2function StdDev(const AMean: TCplx): TCplx;Returns the standard deviation of all calling object complex elements.
└ indexed: function StdDev(const AMean: TCplx; Index: Integer; Len: Integer): TCplx;
3function StdDev(const AMean: Double): Double;Returns the standard deviation of all calling object elements.
└ indexed: function StdDev(const AMean: Double; Index: Integer; Len: Integer): Double;

Overload 1: function StdDev: Double;

Standard deviation.

Returns: Double

Remarks:

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

Examples
var a: Matrix;
    c: double;
    aMean: double;
begin
    a.SetIt(2,2,False,[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.
end;
var
    a: Matrix;
    result: double;
begin
    a := [[1.0, 2.0], [3.0, 4.0]];
    result := a.StdDev;
    if Abs(result - 1.29099444873581) > 1e-10 then
        raise Exception.Create('Matrix.StdDev: expected 1.29099444873581, got ' + result.ToString);
end;

Indexed: function StdDev(Index: Integer; Len: Integer): Double;

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

#NameTypeDescription
1IndexIntegerstart index
2LenIntegerelement count

Returns: Double

Remarks:

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

Overload 2: function StdDev(const AMean: TCplx): TCplx;

Returns the standard deviation of all calling object complex elements.

#NameTypeDescription
1AMeanTCplxpre-computed mean

Returns: TCplx (complex)

Remarks:

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

Indexed: function StdDev(const AMean: TCplx; Index: Integer; Len: Integer): TCplx;

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

#NameTypeDescription
1AMeanTCplxpre-computed mean
2IndexIntegerstart index
3LenIntegerelement count

Returns: TCplx (complex)

Remarks:

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

Overload 3: function StdDev(const AMean: Double): Double;

Returns the standard deviation of all calling object elements.

#NameTypeDescription
1AMeanDoublepre-computed mean

Returns: Double

Remarks:

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

Indexed: function StdDev(const AMean: Double; Index: Integer; Len: Integer): Double;

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

#NameTypeDescription
1AMeanDoublepre-computed mean
2IndexIntegerstart index
3LenIntegerelement count

Returns: Double

Remarks:

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