Covariance

Covariance(self, dim=1)

Updateable covariance matrix.

Uses Welford’s algorithm to stably update the sample mean and (co)variance estimates.

Methods

Name Description
covariance Covariance matrix of the observations.
update Update mean and (co)variance estimates based on new observations.

covariance

Covariance.covariance(ddof=1)

Covariance matrix of the observations.

Parameters

Name Type Description Default
ddof int Delta degrees of freedom (1 for sample covariance, 0 for population) 1

Returns

Name Type Description
np.ndarray Current covariance matrix estimate of shape (dim, dim)

update

Covariance.update(X)

Update mean and (co)variance estimates based on new observations.

Parameters

Name Type Description Default
X np.ndarray (batch_size, dim)-array representing new observations required