gaussian_mle

Gaussian maximum-likelihood estimating schema.

This module provides GaussianMLESchema, which maintains online estimates of mean and covariance using numerically stable incremental updates.

class pysatl_cpd.algorithms.online.cusum.component.estimator.gaussian_mle.EstimatesGaussianMLE[source]

Bases: ISchemaEstimates

mean: UnivariateNumericArray
cov: MultivariateNumericArray
class pysatl_cpd.algorithms.online.cusum.component.estimator.gaussian_mle.GaussianMLESchema(adaptive=True)[source]

Bases: IEstimatingSchema[UnivariateNumericArray, EstimatesGaussianMLE]

Gaussian mean/covariance estimator.

Parameters:

adaptive (bool) – Whether to update estimates online after training. Default is True.

__init__(adaptive=True)[source]
Parameters:

adaptive (bool)

Return type:

None

train(train_set)[source]

Initialise mean/covariance accumulators from a training sample.

Parameters:

train_set (Sequence[ndarray[tuple[int], dtype[double]]]) – Training observations of shape (n_samples, dim).

Return type:

None

update(observation)[source]

Update running mean/covariance with one observation.

Uses Welford’s online algorithm. No-op when adaptive is False.

Parameters:

observation (ndarray[tuple[int], dtype[double]]) – New observation vector.

Return type:

None

property mean: UnivariateNumericArray

Current mean estimate.

Returns:

Mean vector.

Return type:

UnivariateNumericArray

property cov: MultivariateNumericArray

Current covariance estimate (unbiased).

Returns:

Covariance matrix of shape (dim, dim).

Return type:

MultivariateNumericArray

property estimates: EstimatesGaussianMLE

Current estimated parameters as a typed dict.

Return type:

EstimatesGaussianMLE

reset()[source]

Reset all accumulators to initial (untrained) state.

Return type:

None