skbio.stats.composition.vlr#

skbio.stats.composition.vlr(x, y, ddof=1, robust=False)[source]#

Calculate variance log ratio.

Parameters:
xarray_like of shape (n_components,)

A vector of proportions.

yarray_like of shape (n_components,)

A vector of proportions.

ddofint

Degrees of freedom.

robustbool

Whether to mask zeros at the cost of performance.

Returns:
float

Variance log ratio value.

Notes

Variance log ratio was described in [1] and [2].

References

[1]

V. Lovell D, Pawlowsky-Glahn V, Egozcue JJ, Marguerat S, Bähler J (2015) Proportionality: A Valid Alternative to Correlation for Relative Data. PLoS Comput Biol 11(3): e1004075. https://doi.org/10.1371/journal.pcbi.1004075

[2]

Erb, I., Notredame, C. How should we measure proportionality on relative gene expression data?. Theory Biosci. 135, 21-36 (2016). https://doi.org/10.1007/s12064-015-0220-8

Examples

>>> import numpy as np
>>> from skbio.stats.composition import vlr
>>> x = np.exp([1, 2, 3])
>>> y = np.exp([2, 3, 4])
>>> vlr(x, y)  # no zeros
0.0