Re: CHISQR_CVF question. [message #67632 is a reply to message #67631] |
Thu, 20 August 2009 09:53   |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"Craig Markwardt" <craig.markwardt@gmail.com> wrote in message
news:cab41ca6-e1a4-4f73-851f-8b25ab0c1e58@k26g2000vbp.google groups.com...
On Aug 19, 4:42 pm, "R.G. Stockwell" <noemai...@please.com> wrote:
> "Paolo" <pgri...@gmail.com> wrote in message
>
> basically yes, abs(fft(ts))^2, and comparing it to chisquare from the
> IDL functions.
> I have worked on it, but I think the result is off by a factor of 2.
> That is a factor of 2 too stringent.
>
...
> Perhaps you can check my understanding. If we have a 95% significance
> level,
> then if we make a spectrum with 1000 points, shouldnt 50 of them be above
> that 95% line?
Let's say we have a time series, defined like this,
LC = time series values (array)
ERR = measurement uncertainty (array) of each LC point.
I define the power spectrum in the following way,
POW = ABS(FFT(LC,+1))^2 * ( 2 / TOTAL(ERR^2) )
*************************************************
Craig, Sorry but I am a bit confused here.
using the +1 direction is the "inverse" FFT here isn't it?
and hence it lacks the 1/N normalization that occurs on the "forward" FFT.
Is that right?
Also, total(err^2) happens to be equal to the length here, so i looks like
you are doing an inverse FFT ^2, and then dividing by len.
BUT, that is the same as doing the forward FFT (with 1/N), squaring it, then
multiplying
by len.
So, it almost looks like this just happens to be by coincidence the same as
pow = fft(lc, /forward)*length
And you have a factor of 2, which is coincidentally also the power of your
spectrum. and it appears that again this may have just coincidentally
cancelled out.
basically, I am starting with a normalization of the spectrum as:
d = 120*randomn(seed,len)
spe = fft(d)
pspe = abs(spe[0:len/2-1])^2
; normalize wrt length and variance, so we always get the same result
pspe = pspe*(len)
pspe = pspe/stddev(d)^2
with this normalization, the mean of my spectrum is always the same.
(as i vary the length of the time series, and as i vary the standard
deviation,
above i have a stdev of 120).
Are you saying that there should be a factor of 2 in my power spectrum,
i.e. I need a final line that states pspe = pspe*2?
Because, when I do this, I do get the expected result. By expected I mean I
calculate the number of points above the cutoff level (90%) and I find
approximately
10% above, 90% below. ditto 95%, 99%.
But, I want to justify that factor of 2.
cheers,
bob
|
|
|