Closed psychelzh closed 2 months ago
Hello,
Thanks you for reporting the bug. I think there is indeed something wrong with the approximation of the integral of the TFCE, when the values of the statistics are below 1. The issue might come from the cpp code.
#zero
permuco:::tfce_distribution(distribution = matrix(.9),E=0.5,H=1,dh=.1,dhi=c(0.6,.7,.8,.9))
#not zero
permuco:::tfce_distribution(distribution = matrix(1.1),E=0.5,H=1,dh=.1,dhi=c(0.6,.7,.8,.9,1,1.1))
permuco:::tfce_distribution(distribution = matrix(1.1),E=0.5,H=1,dh=.1,dhi=c(.8,.9,1,1.1))
#also zero !?
permuco:::tfce_distribution(distribution = matrix(1.1),E=0.5,H=1,dh=.1,dhi=c(1,1.1))
I double check the cpp code, and I think:
In line
Fixed in 1.1.3 This bug should not have affected the results of TFCE with the usually statistics as they usually have greater than 1.
For example, I generated some random numbers. At first it could give the correct values:
Then I rescale the numbers to smaller values, and the calculations failed.
Created on 2024-08-25 with reprex v2.1.0