Skip to content

Commit

Permalink
DOC: BUG: Correct formulas in spatial.distance. Closes scipy#1391.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Feb 27, 2011
1 parent 5149470 commit 35fe2e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scipy/spatial/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ def cosine(u, v):
.. math::
\frac{1-uv^T}
{||u||_2 ||v||_2}.
1 - \frac{uv^T}
{||u||_2 ||v||_2}.
Parameters
----------
Expand All @@ -298,8 +298,8 @@ def correlation(u, v):
.. math::
\frac{1 - (u - \bar{u}){(v - \bar{v})}^T}
{{||(u - \bar{u})||}_2 {||(v - \bar{v})||}_2^T}
1 - frac{(u - \bar{u}){(v - \bar{v})}^T}
{{||(u - \bar{u})||}_2 {||(v - \bar{v})||}_2^T}
where :math:`\bar{u}` is the mean of a vectors elements and ``n``
is the common dimensionality of ``u`` and ``v``.
Expand Down Expand Up @@ -905,8 +905,8 @@ def pdist(X, metric='euclidean', p=2, w=None, V=None, VI=None):
.. math::
\frac{1 - uv^T}
{{|u|}_2 {|v|}_2}
1 - \frac{uv^T}
{{|u|}_2 {|v|}_2}
where |*|_2 is the 2 norm of its argument *.
Expand All @@ -916,8 +916,8 @@ def pdist(X, metric='euclidean', p=2, w=None, V=None, VI=None):
.. math::
\frac{1 - (u - \bar{u})(v - \bar{v})^T}
{{|(u - \bar{u})|}{|(v - \bar{v})|}^T}
1 - \frac{(u - \bar{u})(v - \bar{v})^T}
{{|(u - \bar{u})|}{|(v - \bar{v})|}^T}
where :math:`\bar{v}` is the mean of the elements of vector v.
Expand Down

0 comments on commit 35fe2e4

Please sign in to comment.