add_component#

MixtureModel.add_component(component, weight)[source]#

Adds a new component to the mix, preserving the proportions of the existing component weights.

If weight is specified for the new component, the old component weights are multiplied by (1 - weight).

Parameters:
  • component (ContinuousDistribution) – The distribution component to add.

  • weight (float) – The weight for the new component, a number in the range (0, 1).

Raises:

ValueError – If the specified weight is outside the range (0, 1).