mlpy.stats.sq_distance

mlpy.stats.sq_distance(p, q, p_sos=None, q_sos=None)[source]

Efficiently compute squared Euclidean distances between stats of vectors.

Compute the squared Euclidean distances between every d-dimensional point in p to every d-dimensional point in q. Both p and q are n-point-by-n-dimensions.

Parameters:

p : array_like, shape (n, dim)

Array where n is the number of points and dim is the number of dimensions.

q : array_like, shape (n, dim)

Array where n is the number of points and dim is the number of dimensions.

p_sos : array_like, shape (dim,)

q_sos : array_like, shape (dim,)

Returns:

ndarray :

The squared Euclidean distance.

Examples

>>> sq_distance()

Note

Adapted from Matlab:

Copyright (2010) Kevin Murphy and Matt Dunham
License: MIT