Skip to content

fix: use the distribution offset as min for iti statistics - #83

Open
arjunsridhar12345 wants to merge 6 commits into
devfrom
82-use-the-distribution-offset-as-min-instead-of-min-for-iti-statistics
Open

fix: use the distribution offset as min for iti statistics#83
arjunsridhar12345 wants to merge 6 commits into
devfrom
82-use-the-distribution-offset-as-min-instead-of-min-for-iti-statistics

Conversation

@arjunsridhar12345

@arjunsridhar12345 arjunsridhar12345 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Attempts to close #82 . Only uses the scaling parameters offset as the min for the iti statistics. The others remain unchanged if I understood correctly

@arjunsridhar12345
arjunsridhar12345 marked this pull request as ready for review August 21, 2026 20:28
# use the distribution offset as the min for iti min
iti_scaling = generator.inter_trial_interval_duration.scaling_parameters
if iti_scaling is not None and iti_scaling.offset is not None:
iti_min = iti_scaling.offset

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably have a check here to take into account the min and offset. Maybe something like

    tp = distribution.truncation_parameters
    base_min = float(tp.min)

    sp = distribution.scaling_parameters
    scale = float(sp.scale) if sp is not None else 1.0
    offset = float(sp.offset) if sp is not None else 0.0

    return base_min * scale + offset

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggesting something like this?

beta: t.Optional[float] = None
params = distribution.distribution_parameters
truncation = distribution.truncation_parameters
scaling = distribution.scaling_parameters
scale = scaling.scale if scaling is not None else 1.0
offset = scaling.offset if scaling is not None else 0.0
minimum = truncation.min if truncation is not None else None
maximum = truncation.max if truncation is not None else None
if params.family == DistributionFamily.EXPONENTIAL and params.rate:
    beta = scale / params.rate
    # An exponential's support starts at the offset once shifted.
    minimum = offset if minimum is None else max(minimum, offset)
elif params.family == DistributionFamily.UNIFORM:
    # A uniform distribution carries its bounds in the distribution
    # parameters rather than the truncation parameters.
    minimum = params.min * scale + offset
    maximum = params.max * scale + offset
return beta, minimum, maximum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants