gaussian_conjugate

Gaussian conjugate likelihood for Bayesian online change-point detection.

class pysatl_cpd.algorithms.online.bayesian.component.likelihood.gaussian_conjugate.GaussianConjugate(mu_0, k_0, alpha_0, beta_0)[source]

Bases: ILikelihood

Normal-Inverse-Gamma conjugate likelihood with Student-t predictive density.

Parameters:
  • mu_0 (float) – Prior mean.

  • k_0 (float) – Prior pseudo-count (must be > 0).

  • alpha_0 (float) – Prior shape (must be > 0).

  • beta_0 (float) – Prior scale (must be > 0).

Raises:

ValueError – If any of k_0, alpha_0, beta_0 are non-positive.

__init__(mu_0, k_0, alpha_0, beta_0)[source]
Parameters:
Return type:

None

update(observation)[source]

Update posterior sufficient statistics with a new observation.

Mutates internal parameter arrays by appending new posterior values (prepended with the prior at index 0).

Parameters:

observation (double) – New observation to incorporate.

Return type:

None

predict(observation, window=None)[source]

Return predictive log-probabilities under Student-t densities.

First element is the prior predictive log-likelihood; remaining elements are posterior predictive log-likelihoods for the most recent window run-length states.

Parameters:
  • observation (double) – Observation to evaluate.

  • window (int | None) – Maximum number of posterior states to consider. Defaults to all accumulated states.

Returns:

Array of log-probabilities.

Return type:

GenericAlias[double]

clear()[source]

Reset all posterior parameter arrays to empty.

Return type:

None