Skip to content

ENH: vectorize cov #502

@mdhaber

Description

@mdhaber

cov currently expects an array with at most two dimensions. Given a single $m$-dimensional sample composed of $n$ observations as an array with shape (m, n), it produces one $m \times m$ covariance matrix as an array of shape (m, m).

It would be useful if cov were vectorized operate on arrays of arbitrary dimensionality as a batch. Given a batch of samples as an array with shape batch_shape + (m, n), it would produce a batch of covariance matrices as an array of shape batch_shape + (m, m).

This would be consistent with other standard functions like matmul. matrix_transpose, and many linalg extension functions.

(I'd have an immediate use for this vectorizing scipy.stats.epps_singleton_2samp.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions