Sleipnir
Public Member Functions
Sleipnir::CMeasureSpearman Class Reference

Calculates Spearman's rank correlation between two vectors (centering as per EMap, weights ignored). More...

#include <measure.h>

Inheritance diagram for Sleipnir::CMeasureSpearman:
Sleipnir::CMeasureSpearmanImpl Sleipnir::IMeasure

Public Member Functions

 CMeasureSpearman (bool fTransformed)
 Construct a new Spearman correlation measure with the indicated ranking behavior.
double Measure (const float *adX, size_t iN, const float *adY, size_t iM, EMap eMap=EMapNone, const float *adWX=NULL, const float *adWY=NULL) const
 Calculate the measure between two given vectors with optional element weights.
const char * GetName () const
 Return the human-readable unique identifier of the measure type.
bool IsRank () const
 Return true if the measure requires rank-based integer inputs.
IMeasureClone () const
 Create a copy of the current measure object.

Detailed Description

Calculates Spearman's rank correlation between two vectors (centering as per EMap, weights ignored).

Definition at line 501 of file measure.h.


Constructor & Destructor Documentation

Sleipnir::CMeasureSpearman::CMeasureSpearman ( bool  fTransformed) [inline]

Construct a new Spearman correlation measure with the indicated ranking behavior.

Parameters:
fTransformedIf true, all inputs are assumed to be pre-rank transformed; otherwise, rank-transforming is performed for each Measure call.
Remarks:
If you're going to measure all pairwise combinations of some set (e.g. turn a PCL into a CDat), it is much more efficient to pre-transform all input vectors and construct a Spearman measure with fTransformed set to true. This avoids repeatedly re-ranking each vector.

Definition at line 516 of file measure.h.

Referenced by Clone().


Member Function Documentation

IMeasure* Sleipnir::CMeasureSpearman::Clone ( ) const [inline, virtual]

Create a copy of the current measure object.

Returns:
Copy of the current measure object.
Remarks:
Caller is, of course, responsible for destroying the created object.

Implements Sleipnir::IMeasure.

Definition at line 529 of file measure.h.

References CMeasureSpearman().

const char* Sleipnir::CMeasureSpearman::GetName ( ) const [inline, virtual]

Return the human-readable unique identifier of the measure type.

Returns:
The string identifier of the measure type.

Implements Sleipnir::IMeasure.

Definition at line 521 of file measure.h.

bool Sleipnir::CMeasureSpearman::IsRank ( ) const [inline, virtual]

Return true if the measure requires rank-based integer inputs.

Returns:
True if the measure requires rank-based input vectors.
Remarks:
The input vectors for rank measures should contain only floating point values with no fractional part; behavior is undefined if they don't.

Implements Sleipnir::IMeasure.

Definition at line 525 of file measure.h.

double Sleipnir::CMeasureSpearman::Measure ( const float *  adX,
size_t  iN,
const float *  adY,
size_t  iM,
EMap  eMap = EMapNone,
const float *  adWX = NULL,
const float *  adWY = NULL 
) const [virtual]

Calculate the measure between two given vectors with optional element weights.

Parameters:
adXFirst array of values.
iNLength of first array.
adYSecond array of values.
iMLength of second array.
eMapWay in which returned value should be centered (implementation-specific).
adWXIf non-null, weights of elements in the first array.
adWYIf non-null, weights of elements in the second array.
Returns:
Measure calculated between the two input vectors and, optionally, weights.
Remarks:
Pretty much every implementation will puke if given bad input; bounds checking etc. is minimal.

Implements Sleipnir::IMeasure.

Definition at line 713 of file measure.cpp.

References Sleipnir::IMeasure::EMapAbs, Sleipnir::IMeasure::EMapCenter, and Sleipnir::CMeta::GetNaN().


The documentation for this class was generated from the following files: