Skip to content

Truncated gamma fit#243

Merged
chiarabellenghi merged 3 commits intomasterfrom
truncated_gamma_fit
Oct 20, 2025
Merged

Truncated gamma fit#243
chiarabellenghi merged 3 commits intomasterfrom
truncated_gamma_fit

Conversation

@chiarabellenghi
Copy link
Copy Markdown
Member

This PR adds a function to fit a truncated gamma function to a set of values.
It is used by functions that fit this function to the distribution of TS values for various purposes.
The arguments of the function have generic names, as it could potentially be used to fit observables other than the TS.

raise ImportError(
'The iminuit module was not imported! '
'This module is a requirement of the function '
'"calculate_critical_ts_from_gamma"!')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'"calculate_critical_ts_from_gamma"!')
'"fit_truncated_gamma"!')

eta : float, optional
vals : (n_trials,)-shaped 1D ndarray of float
eta : float
Test-statistic value at which the gamma function is truncated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Test-statistic value at which the gamma function is truncated
Value at which the gamma function is truncated

Comment on lines 168 to 172
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ah, not sure if the suggestion worked out. I'd remove this check here, because it is already in the function

@chiarabellenghi chiarabellenghi merged commit ea5a9be into master Oct 20, 2025
6 checks passed
@chiarabellenghi chiarabellenghi deleted the truncated_gamma_fit branch October 20, 2025 09:26
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.

2 participants