Is the example wrong for "Significance Testing for Periodic Component"?
显示 更早的评论
I think there is an error in the example for Fisher's g-statistic test for periodicity on the MathWorks site. Here is the link:
Towards the bottom of the example, they are getting the distribution of the g-statistic and they calculate the variable "upper" where "upper = floor(1/fisher_g);", but then they don't ever use the term later.
I believe the term should be used on the next line. Instead of "for nn = 1:3", I believe it should be "for nn = 1:upper" which would also match this source on the test: "Statistical Power of Fisher Test for the Detection of Short Periodic Gene Expression Profiles" by Liew, Law, Cao, and Yan, here is a link:
https://pdfs.semanticscholar.org/9145/fa42300594a1a100d57529f07333ec010ae4.pdf
Page 4, equation (4) shows how to get the distribution of the g-statistic
3 个评论
Walter Roberson
2018-5-30
If you visit that page then on the bottom right there is a "Is this topic helpful" button pair. If you click No then it will take you to a form where you can enter documentation feedback. Mathworks does read what you enter there; I have often received replies.
Anton Roodnat
2019-3-10
I think the upper value should indeed be used when looking at eq (6) in ref [2].
I tried replacing 1:3 by 1:upper but this results in inaccuracy problems because a very large value is being multiplied by a very small value.
This problem can be solved by using a recursive calculation instead of a 'direct' one :
use_direct_calculation = 0 ;
use_recursive = 1 ;
if use_direct_calculation
N = length(Pxx);
upper = floor(1/fisher_g);
for nn = 1:upper
I(nn) = (-1)^(nn-1)*nchoosek(N,nn)*(1-nn*fisher_g)^(N-1);
end
pval = sum(I)
end
% Alternative method using recursive equations :
if use_recursive
N = length(Pxx);
upper = floor(1/fisher_g);
L(1)=nchoosek(N,1)*(1-fisher_g)^(N-1);
for nn = 2:upper
A1 = (N-nn+1)/nn ;
A2 = -1 ;
A3 = ((1-nn*fisher_g)/(1-(nn-1)*fisher_g))^(N-1) ;
A = A1*A2*A3 ;
L(nn) = L(nn-1)*A ;
end
pval = sum(L)
end
The latter approach works ok. Anyway it turns out that at least for the given example, the larger values of L (or I) are negligible. This may not always be the case though,
Duncan Carlsmith
2025-3-11
The example https://www.mathworks.com/help/signal/ug/significance-testing-for-periodic-component.html cites Wichert, Sofia, Konstantinos Fokianos, and Korbinian Strimmer. "Identifying Periodically Expressed Transcripts in Microarray Time Series Data." Bioinformatics. Vol. 20, 2004, pp. 5-20. I stumbled upon a 2008 correction to that paper https://academic.oup.com/bioinformatics/article/24/19/2274/249128 and can't quite tell if it is implemented. Is it?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!