iblrig.misc.truncated_exponential
- iblrig.misc.truncated_exponential(scale=0.35, min_value=0.2, max_value=0.5)[source]
Generate a truncated exponential random variable within a specified range.
- Parameters:
- Returns:
Truncated exponential random variable.
- Return type:
- Parameters:
Notes
This function generates a random variable from an exponential distribution with the specified scale. It then checks if the generated value is within the specified range [min_value, max_value]. If it is within the range, it returns the generated value; otherwise, it recursively generates a new value until it falls within the specified range.
The scale should typically be greater than or equal to the min_value to avoid potential issues with infinite recursion.