Documentation

MathematicsFunctions

Class MathematicsManager

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Methods

AlmeidaDistance()  : float
Distance between two oligonucleotide frequency tables, based on a modified Pearson correlation (Almeida et al, 2001) http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=11331237
EuclideanDistance()  : float
Euclidean distance between two oligonucleotide frequency tables, scaled by the table size (Wang et al, Gene 2005; 346:173-185)
Mean()  : float|int
Calculates the mean, the null entries left out
Median()  : float|int
Calculates the median, the null entries left out
PearsonDistance()  : float
Pearson distance (1 - r) between two series of values sharing the same keys. A correlation that only differs from 1 by rounding noise is taken as exactly 1, so identical series give 0.
Variance()  : float|int
Calculates the variance (sample variance, n - 1), the null entries left out
unroundedMean()  : float|int
The mean of the values, the null entries left out, unrounded

Methods

AlmeidaDistance()

Distance between two oligonucleotide frequency tables, based on a modified Pearson correlation (Almeida et al, 2001) http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=11331237

public static AlmeidaDistance(array<string|int, mixed> $aValsX, array<string|int, mixed> $aValsY) : float
Parameters
$aValsX : array<string|int, mixed>

Values for X

$aValsY : array<string|int, mixed>

Values for Y, indexed like $aValsX

Tags
throws
InvalidArgumentException

When the tables do not have the same size, share no word present in both (all weights x.y zero) or one of them is constant over the words they share (zero weighted variance) : the correlation is then undefined

Return values
float

EuclideanDistance()

Euclidean distance between two oligonucleotide frequency tables, scaled by the table size (Wang et al, Gene 2005; 346:173-185)

public static EuclideanDistance(array<string|int, mixed> $aValsX, array<string|int, mixed> $aValsY, int $iOligoLen) : float
Parameters
$aValsX : array<string|int, mixed>

Frequencies of the first sequence, by oligonucleotide

$aValsY : array<string|int, mixed>

Frequencies of the second sequence, by oligonucleotide

$iOligoLen : int

Length of the oligonucleotides

Return values
float

Mean()

Calculates the mean, the null entries left out

public static Mean(array<string|int, mixed> $data[, int|null $iPrecision = 3 ]) : float|int
Parameters
$data : array<string|int, mixed>
$iPrecision : int|null = 3

Decimals the result is rounded to, 3 by default (the historical behaviour). Null returns it unrounded : a mean of frequencies or skews, of the order of 1e-4, is rounded to 0 by the default.

Tags
throws
Exception
Return values
float|int

Median()

Calculates the median, the null entries left out

public static Median(array<string|int, mixed> $data) : float|int
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception
Return values
float|int

PearsonDistance()

Pearson distance (1 - r) between two series of values sharing the same keys. A correlation that only differs from 1 by rounding noise is taken as exactly 1, so identical series give 0.

public static PearsonDistance(array<string|int, mixed> $aValsX, array<string|int, mixed> $aValsY) : float
Parameters
$aValsX : array<string|int, mixed>

Values for X

$aValsY : array<string|int, mixed>

Values for Y, indexed like $aValsX

Tags
throws
InvalidArgumentException

When the series do not have the same size

DivisionByZeroError

When one of the series is constant

Return values
float

Variance()

Calculates the variance (sample variance, n - 1), the null entries left out

public static Variance(array<string|int, mixed> $data[, int|null $iPrecision = 3 ]) : float|int
Parameters
$data : array<string|int, mixed>
$iPrecision : int|null = 3

Decimals the result is rounded to, 3 by default (the historical behaviour). Null returns it unrounded : the variance of frequencies, of the order of 1e-6, is rounded to 0 by the default.

Tags
throws
Exception
Return values
float|int

unroundedMean()

The mean of the values, the null entries left out, unrounded

private static unroundedMean(array<string|int, mixed> $data) : float|int
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception
Return values
float|int
On this page

Search results