Displaying 1 result from an estimated 1 matches for "squares_spectral_analysis".
2009 Jun 19
1
typo in Lomb-Scargle periodogram implementation in spec.ls() from cts package?
...h(ti)]* cos(2 * pi * freq.temp[k] * (ti - tao))))^2/sum((cos(2 *
pi * freq.temp[k] * (ti - tao)))^2) + (sum(x[1:length(ti)] * sin(2 * pi * freq.temp[k] * (ti - tao))))^2/sum((sin(2 * pi * freq.temp[k] * (ti - tao)))^2) ===> ) <===
Here is quick reference http://en.wikipedia.org/wiki/Least-squares_spectral_analysis#The_Lomb.E2.80.93Scargle_periodogram . One half coefficient was not applied to entire expression.
Also I find weird next lines (61-62)
pgram[1, i, j] <- 0.5 * (pgram[2, i, j] + pgram[N, i, j])
First of all, such things should not be in the for loop. Second, I don't quite understand the me...