Skip to content

A proposal to make the correlated t-test less conservative#1

Open
NeeleKemper wants to merge 1 commit intodpaetzel:mainfrom
NeeleKemper:fix-corr-test
Open

A proposal to make the correlated t-test less conservative#1
NeeleKemper wants to merge 1 commit intodpaetzel:mainfrom
NeeleKemper:fix-corr-test

Conversation

@NeeleKemper
Copy link

In the correlated t-test, the squared variance should be used as the scale parameter, as the scipy.stats.t expects the standard deviation.

See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html

rho = self.fraction_test

sigma_2_hat = ((x - x_over) ** 2).sum() / (n - 1)
corrected_sigma_2_hat = (1 / n + rho / (1 - rho)) * sigma_2_hat # Corrected variance using Nadeau-Bengio's correction
Copy link
Owner

Choose a reason for hiding this comment

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

Please comment above the lines to keep the lines the comments refer to (to keep lines at less than 80 characters). Also, please end comments with a full stop.

@heidmic
Copy link

heidmic commented Oct 7, 2024

Note that it makes the tests more conservative for variances < 1 (which would be quite common for losses or other error metrics, especially on standardized datasets) and only less conservative on higher values. However, from my testing of this PR, the results feel more 'correct' for the smaller values. In the sense that they align better with my visual interpretations of plotting the runs individually

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