[FieldTrip] Setting random seed for ft_freqstatistics

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Wed Jul 9 10:06:54 CEST 2025


Hi Annie,

Yes, It should be possible to use cfg.randomseed also for the ft_<something>statistics. Note, IMPORTANT, that this option won’t work if you use ft_statistics_montecarlo directly. Also see this: https://github.com/fieldtrip/fieldtrip/pull/2268<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip%2Fpull%2F2268&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd1e0fc7e8bab45bc6ef008ddbebf9194%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638876452174646459%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=TnCF9DvaHdfy72gO6gI7obqu3JtAQ6jWcFSU1xXclwY%3D&reserved=0>, which we haven’t gotten around to resolve in a satisfactory manner yet. Feel free to chime in in the linked discussion.

I think an easy check would be to call ft_freqstatistics twice (with the same random seed), and assert numerical equivalency of the relevant fields in the output data structures.

Best wishes,
Jan-Mathijs


On 8 Jul 2025, at 21:13, Annie Menart via fieldtrip <fieldtrip at science.ru.nl> wrote:

Dear Fieldtrippers,

For cluster-based permutations (ft_freqstatistics), can you set the seed using cfg.randomseed? In the documentation, we've seen it used for ft_componentanalysis, but we weren't sure if it also worked for ft_freqstatistics. We have it running with no errors, but wanted to make sure since we didn't see the parameter cfg.randomseed used directly in ft_freqstatistics. If not, is there a way to set the seed?

Best,
Annie

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd1e0fc7e8bab45bc6ef008ddbebf9194%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638876452174672429%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=aQHh6c%2FsxuLrXliYq0tni7MaqsrEX52nKd72UVkeKGk%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd1e0fc7e8bab45bc6ef008ddbebf9194%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638876452174694294%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=SCRx35W45QxU1acoXnfIZxq3pl8b9P5NYOSAn08kVEU%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250709/cafb5f3c/attachment.htm>


More information about the fieldtrip mailing list