BDM.PerturbationAnalysis (BDM v0.5.0)

View Source

Tools for analyzing how perturbations affect BDM complexity estimates in order to identify complexity-driving elements, sensitivity, critical points and stability.

Summary

Functions

Calculates BDM for original and all perturbed versions.

Identifies positions where perturbation sensitivity exceeds threshold.

Creates a landscape showing cumulative effects of multi-bit perturbations.

Generates random perturbations with specified noise level. noise_level: fraction of bits to flip (0.0 to 1.0)

Creates a sensitivity profile showing which positions are most sensitive to perturbation.

Generates all possible single-bit flip perturbations of the data.

Calculates stability coefficient: ratio of consistent complexity estimates.

Functions

calculate_perturbation_effects(bdm, original_data, perturbations)

@spec calculate_perturbation_effects(
  BDM.t(),
  BDM.binary_string() | BDM.binary_matrix(),
  list()
) ::
  {float(), [map()]}

Calculates BDM for original and all perturbed versions.

detect_critical_positions(sensitivity_profile, threshold \\ 1.0)

@spec detect_critical_positions([map()], number()) :: [map()]

Identifies positions where perturbation sensitivity exceeds threshold.

perturbation_landscape(bdm, data, radius)

@spec perturbation_landscape(
  BDM.t(),
  BDM.binary_string() | BDM.binary_matrix(),
  integer()
) :: [map()]

Creates a landscape showing cumulative effects of multi-bit perturbations.

Returns max_effect, min_effect, and avg_effect for each flip count, providing more insight into the perturbation behavior.

random_perturbations(bdm, data, num_perturbations, noise_level)

@spec random_perturbations(
  BDM.t(),
  BDM.binary_string() | BDM.binary_matrix(),
  pos_integer(),
  number()
) :: BDM.binary_string() | BDM.binary_matrix()

Generates random perturbations with specified noise level. noise_level: fraction of bits to flip (0.0 to 1.0)

sensitivity_profile(bdm, data)

@spec sensitivity_profile(BDM.t(), BDM.binary_string() | BDM.binary_matrix()) :: [
  map()
]

Creates a sensitivity profile showing which positions are most sensitive to perturbation.

single_bit_perturbations(bdm, data)

@spec single_bit_perturbations(BDM.t(), BDM.binary_string() | BDM.binary_matrix()) ::
  BDM.binary_string() | BDM.binary_matrix()

Generates all possible single-bit flip perturbations of the data.

stability_coefficient(bdm, data, num_trials \\ 50, noise_level \\ 0.1)

@spec stability_coefficient(
  BDM.t(),
  BDM.binary_string() | BDM.binary_matrix(),
  pos_integer(),
  number()
) :: map()

Calculates stability coefficient: ratio of consistent complexity estimates.