With regards to the F cumulative distribution function will the cdf method of the scipy.stats.f object do the trick? 

<div>-------- Original message --------</div><div>From: Virgile Fritsch <notifications@github.com> </div><div>Date:18/02/2014  16:27  (GMT+01:00) </div><div>To: nilearn/nilearn <nilearn@noreply.github.com> </div><div>Cc: Gael Varoquaux <gael.varoquaux@normalesup.org> </div><div>Subject: Re: [nilearn] ENH: Add Massively Univariate Linear Model with  permuted OLS. (#157) </div><div>
</div>In nilearn/mass_univariate/tests/test_permuted_least_squares.py:

> +from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
> +                           assert_equal)
> +
> +from nilearn.mass_univariate import permuted_ols
> +
> +from nilearn._utils.fixes import f_regression
> +
> +
> +### Tests for labels swapping permutation scheme ##############################
> +def test_permuted_ols_gstat():
> +    """Compare the results to a former implementation.
> +
> +    """
> +    # Load input data
> +    cur_dir = os.path.dirname(os.path.abspath(__file__))
> +    data = np.load(os.path.join(cur_dir, 'testing_data.npz'))
@agramfort Ok. Thanks for the link. It is similar to Bertrand's suggestion: checking that we obtain significant or non-significant p-values according to controlled designs.

@bthirion Thanks for this result that I was not aware of. Actually I found no simple and concise way to compute the values corresponding to n.f.F^{n-1}'s cumulative density function so I relied on the fact that the max is equal to the single available score when n_targets == 1.

I added a test about the improvement of h0's estimation when n_perm increases (i.e. consistency of the algorithm).

Thanks @rphlypo for very helpful suggestions. Does it look like what you had in mind?

—
Reply to this email directly or view it on GitHub.