Sleipnir
|
Calculates the Pearson correlation between the two vectors. More...
#include <measure.h>
Public Member Functions | |
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. | |
IMeasure * | Clone () const |
Create a copy of the current measure object. | |
double | Measure (const float *adX, size_t iM, const float *adY, size_t iN, EMap eMap, const float *adWX, const float *adWY) const |
Calculate the measure between two given vectors with optional element weights. | |
Static Public Member Functions | |
static double | Pearson (const float *adX, size_t iN, const float *adY, size_t iM, EMap eMap, const float *adWX=NULL, const float *adWY=NULL, size_t *piCount=NULL) |
Calculates the Pearson correlation between the vectors. |
Calculates the Pearson correlation between the two vectors.
Calculates Pearson correlation between two vectors; if weights are given, the means and each pairwise product are also multiplied by the appropriate elements' weights. Centering is performed as per EMap.
IMeasure* Sleipnir::CMeasurePearson::Clone | ( | ) | const [inline, virtual] |
Create a copy of the current measure object.
Implements Sleipnir::IMeasure.
const char* Sleipnir::CMeasurePearson::GetName | ( | ) | const [inline, virtual] |
Return the human-readable unique identifier of the measure type.
Implements Sleipnir::IMeasure.
bool Sleipnir::CMeasurePearson::IsRank | ( | ) | const [inline, virtual] |
Return true if the measure requires rank-based integer inputs.
Implements Sleipnir::IMeasure.
double Sleipnir::CMeasurePearson::Measure | ( | const float * | adX, |
size_t | iN, | ||
const float * | adY, | ||
size_t | iM, | ||
EMap | eMap, | ||
const float * | adWX, | ||
const float * | adWY | ||
) | const [inline, virtual] |
Calculate the measure between two given vectors with optional element weights.
adX | First array of values. |
iN | Length of first array. |
adY | Second array of values. |
iM | Length of second array. |
eMap | Way in which returned value should be centered (implementation-specific). |
adWX | If non-null, weights of elements in the first array. |
adWY | If non-null, weights of elements in the second array. |
Implements Sleipnir::IMeasure.
Definition at line 413 of file measure.h.
References Pearson().
double Sleipnir::CMeasurePearson::Pearson | ( | const float * | adX, |
size_t | iM, | ||
const float * | adY, | ||
size_t | iN, | ||
EMap | eMap, | ||
const float * | adWX = NULL , |
||
const float * | adWY = NULL , |
||
size_t * | piCount = NULL |
||
) | [static] |
Calculates the Pearson correlation between the vectors.
adX | First array of values. |
iN | Length of first array. |
adY | Second array of values. |
iM | Length of second array. |
eMap | Way in which returned value should be centered. |
adWX | If non-null, weights of elements in the first array. |
adWY | If non-null, weights of elements in the second array. |
piCount | If non-null, outputs the number of non-NaN elements used for the calculation. |
Calculates Pearson correlation between two vectors; if weights are given, the means and each pairwise product are also multiplied by the appropriate elements' weights. Centering is performed as per EMap.
Definition at line 398 of file measure.cpp.
References Sleipnir::IMeasure::EMapAbs, Sleipnir::IMeasure::EMapCenter, Sleipnir::CMeta::GetNaN(), and Sleipnir::CMeta::IsNaN().
Referenced by Measure(), Sleipnir::CMeasurePearNorm::Measure(), Sleipnir::CMeasurePearsonSignificance::Measure(), and Sleipnir::CMeasureSignedDistanceCorrelation::Measure().