canari.component.bounded_autoregression_component#

class canari.component.bounded_autoregression_component.BoundedAutoregression(std_error: float, phi: float, gamma: float | None = None, mu_states: list[float] | None = None, var_states: list[float] | None = None)[source]#

Bases: BaseComponent

BoundedAutoregression class, inheriting from Canari’s BaseComponent. It models residuals following a univariate AR(1) process with optional constrains defined by a coefficient (gamma), which scales the standard deviation of the stationary AR.

Parameters:
  • std_error ([float]) – Known standard deviation of the process noise.

  • phi ([float]) – Known autoregressive coefficient.

  • gamma (Optional[float]) – Coefficient to scale the standard deviation of the stationary AR. If none, no constraint is applied.

  • mu_states (Optional[list[float]]) – Initial mean of the hidden state. Defaults: initialized to zeros.

  • var_states (Optional[list[float]]) – Initial variance of the hidden state. Defaults: initialized to zeros.

Behavior:
  • Adds 1 extra state, i.e. X^{BAR}, if gamma is provided. Otherwise no constraint is applied.

References

Xin, Z. and Goulet, J.-A. (2024). Enhancing structural anomaly detection using a bounded autoregressive component. Mechanical Systems and Signal Processing. Volume 212, pp.111279.

Examples

>>> from canari.component import BoundedAutoregression
>>> # with gamma
>>> bar = BoundedAutoregression(std_error=1, phi=0.75, gamma=0.5)
>>> # without gamma
>>> bar_1 = BoundedAutoregression(std_error=1, phi=0.75)
initialize_component_name()[source]#

Initialize the component’s name. str.

initialize_mu_states()[source]#

Initialize the mean of the hidden states. Output an 2D array.

initialize_num_states()[source]#

Initialize the number of hidden states. int.

initialize_observation_matrix()[source]#

Initialize the observation matrix. Output an 2D array.

initialize_process_noise_matrix()[source]#

Initialize the process noise covariance matrix. Output an 2D array.

initialize_states_name()[source]#

Initialize the names of all hidden states. list[str].

initialize_transition_matrix()[source]#

Initialize the transition matrix. Output an 2D array.

initialize_var_states()[source]#

Initialize the covariance matrix of the hidden states. Output an 2D array.