constant

Constant hazard model for Bayesian online change-point detection.

class pysatl_cpd.algorithms.online.bayesian.component.hazard.constant.ConstantHazard(lambda_)[source]

Bases: IHazard

Constant hazard model with fixed timescale.

Parameters:

lambda_ (float) – Expected run length (must be >= 1.0).

Raises:

ValueError – If lambda_ < 1.0.

__init__(lambda_)[source]
Parameters:

lambda_ (float)

Return type:

None

hazard(run_lengths)[source]

Return constant log-hazard and log-survival for each run length.

Parameters:

run_lengths (GenericAlias[int_]) – Array of run length indices (used only for shape).

Returns:

Pair of (log_hazard, log_survival) arrays broadcast to match the shape of run_lengths.

Return type:

tuple[GenericAlias[double], GenericAlias[double]]