You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance: faster pvalues for studentized range distribution #9476
scipy computes cdf through numerical integration with relatively strong requirement for tolerance.
ppf is not implemented and needs function inversion.
This is much slower than using values from a table according to the scipy issue
We could reduce tolerance for cdf computation (scipy has no option), but it still requires function inversion to get pvalues.
So, we could add an option to tukey_hsd to use the old tables as alternative to scipy version.
Also we could extend the approximation tables by using the values computed by scipy studentized_range.
tukey_hsd has (now redundant) critical value ppf computation #4379 (comment)
computing pvalues (cdf) is enough and in contrast to ppf does not need function inversion.
correction
computing q_crit is not redundant, It is used for confints which are always computed.
What results are you using from tukey-hsd?
only pvalues and rejection decision or also confidence intervals and summary table?
Currently we are always computing the critical values q_crit, which is the ppf value. That requires function inversion in addition to numerical integration. If we only compute p-values in the minimal return case, then we only need to compute the cdf value once without needing the additional function inversion for ppf.
Currently this is difficult to change because all results are always computed (by the underlying helper function).
I'm currently looking at enhancements and possible refactorings in #4379
Activity
josef-pkt commentedon Jan 21, 2025
another speedup
tukey_hsd has (now redundant) critical value ppf computation
#4379 (comment)
computing pvalues (cdf) is enough and in contrast to ppf does not need function inversion.
correction
computing q_crit is not redundant, It is used for confints which are always computed.
josef-pkt commentedon Jan 23, 2025
@Ronny-PDT
What results are you using from tukey-hsd?
only pvalues and rejection decision or also confidence intervals and summary table?
Currently we are always computing the critical values q_crit, which is the ppf value. That requires function inversion in addition to numerical integration. If we only compute p-values in the minimal return case, then we only need to compute the cdf value once without needing the additional function inversion for ppf.
Currently this is difficult to change because all results are always computed (by the underlying helper function).
I'm currently looking at enhancements and possible refactorings in #4379
Ronny-PDT commentedon Jan 23, 2025
josef-pkt commentedon Jan 23, 2025
Thanks
I will try to refactor it to make critical values lazy and computed only on demand.