comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: CHISQR_CVF question.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: CHISQR_CVF question. [message #67642 is a reply to message #67640] Thu, 20 August 2009 01:03 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
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) )
which is to say, it is normalized by the total variance of the time
series, and a factor of 2. Assuming LC is real, then really only the
first half of POW is independent.

Then POW should be distributed like a chi-square with 2 degrees of
freedom. The mean value should be 2, the standard deviation should be
2. I just verified this with some random data.

I verified that CHISQR_CVF() produced reasonable numbers, compared to
my own MPCHILIM() function, which also computes confidence limits.
Sample code below.

Craig


lc = randomn(seed,2000)
err = dblarr(2000) + 1
POW = ABS(FFT(LC,+1))^2 * ( 2 / TOTAL(ERR^2) )
pow1 = pow(0:1000) ;; First half of power spectrum

print, avg(pow1)
;; ==> 1.9769791
print, stddev(pow1)
;; ==> 1.9997902

print, chisqr_cvf(0.05d, 2d)
;; ==> 5.9914659
print, mpchilim(0.05d, 2d, /slevel)
;; ==> 5.9914645
help, where(pow1 GE 5.9914645d)
;; ==> <Expression> LONG = Array[38]
;; (in other words, 38 out of 1000 or 3.8% of data exceeded
threshold)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Loop Multiple Files and Rename
Next Topic: Re: Voxels in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:56:09 PDT 2025

Total time taken to generate the page: 1.04600 seconds