Is the example wrong for "Significance Testing for Periodic Component"?

10 visualizaciones (últimos 30 días)
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 comentarios
Anton Roodnat
Anton Roodnat el 10 de Mzo. de 2019
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
Duncan Carlsmith el 11 de Mzo. de 2025
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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Parallel Computing en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by