iblrig.misc.draw_contrast

iblrig.misc.draw_contrast(contrast_set, probability_type='biased', idx=-1, idx_probability=0.5)[source]

Draw a contrast value from a given iterable based to the specified probability type.

Parameters:
  • contrast_set (list[float]) – The set of contrast values from which to draw.

  • probability_type (Literal[``”skew_zero”, ``"biased", "uniform"], optional) – The type of probability distribution to use. - “skew_zero” or “biased”: Draws with a biased probability distribution based on idx and idx_probability, - “uniform”: Draws with a uniform probability distribution. Defaults to “biased”.

  • idx (int, optional) – Index for probability manipulation (with “skew_zero” or “biased”), default: -1.

  • idx_probability (float, optional) – Probability for the specified index (with “skew_zero” or “biased”), default: 0.5.

Returns:

The drawn contrast value.

Return type:

float

Raises:

ValueError – If an unsupported probability_type is provided.

Parameters:
  • contrast_set (list[float])

  • probability_type (Literal['skew_zero', 'biased', 'uniform'])

  • idx (int)

  • idx_probability (float)