Frederic-vW / eeg_microstates

EEG microstate analysis
MIT License
36 stars 17 forks source link

Confidence interval calculation #2

Closed jiawenjun1 closed 4 years ago

jiawenjun1 commented 4 years ago

Thanks for your source code.

I met an issue when I calculated the confidence interval of surrogate data. On one hand, you used the np.percentileto to calculate the confidence interval located in the [0.25, 97.25]. On the other hand, I used t distribution and norm distribution to calculate the mean of the confidence interval of surrogate data. I found that the two results were significantly different.

Indeed, the range of results based on t distribution was smaller than that based on percentile.

I am not sure which one is more accurate and appropriate to calculate the confidence interval of surrogate data in this scenario.

May you help me solve this issue?

Frederic-vW commented 4 years ago

Hi Wenjun, thank you for your interest in my work. Regarding confidence intervals, I would use percentiles, they provide a non-parametric estimator. A t-distribution allows negative values, which are impossible for AIF components (mutual information is always non-negative). Another point: the numpy percentile function should read np.percentile(_, 2.5, 97.5) to get a two-sided 5% confidence interval. Kind regards, Fred