fix: use the distribution offset as min for iti statistics - #83
Merged
arjunsridhar12345 merged 8 commits intoAug 28, 2026
Conversation
arjunsridhar12345
marked this pull request as ready for review
August 21, 2026 20:28
alexpiet
approved these changes
Aug 21, 2026
micahwoodard
requested changes
Aug 21, 2026
| # 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 |
There was a problem hiding this comment.
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
Collaborator
Author
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Yeah I think something like that should work. Would probably be worth adding a test or something to iterate through different cases and validate
Collaborator
Author
There was a problem hiding this comment.
I forgot to commit this. should be here: 17b6141
…-of-min-for-iti-statistics
…n-offset-as-min-instead-of-min-for-iti-statistics
…n-offset-as-min-instead-of-min-for-iti-statistics
micahwoodard
approved these changes
Aug 28, 2026
micahwoodard
left a comment
There was a problem hiding this comment.
Looks good. Thanks for additions and sorry for the approval wait :)
arjunsridhar12345
deleted the
82-use-the-distribution-offset-as-min-instead-of-min-for-iti-statistics
branch
August 28, 2026 16:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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