Re: autocorrelation with Missing Values [message #60856] |
Wed, 18 June 2008 14:23 |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"maffie" <matthias.demuzere@geo.kuleuven.be> wrote in message
news:42eed0b4-8a8a-4659-9444-c73eb1d0fd35@m44g2000hsc.google groups.com...
> Hi,
>
> I would like to perform an autocorrelation with a few missing values
> in the array (I used 'Nan' and blank spaces as missing values). Now,
> If I try the routine a_correlate, the calculated effective degrees of
> freedom results in Nan, and so is also my new correlation coefficient.
>
> Does anybody know how I can solve this?
>
> Thank you!
> Matthias
Interpolate through the missing data. Just ignoring
them or replacing them with zeros may cause some problems
in the autocorrelation.
Cheers,
bob
PS in old signal processing lore, it used to be said that if one
had gappy data, one should perform spectral analysis on the
ACF cause it did not have gaps. But, it actually does have the
gaps, they are just spread around.
|
|
|
Re: autocorrelation with Missing Values [message #60867 is a reply to message #60856] |
Wed, 18 June 2008 07:20  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
maffie <matthias.demuzere@geo.kuleuven.be> writes:
> Hi,
>
> I would like to perform an autocorrelation with a few missing values
> in the array (I used 'Nan' and blank spaces as missing values). Now,
> If I try the routine a_correlate, the calculated effective degrees of
> freedom results in Nan, and so is also my new correlation coefficient.
>
> Does anybody know how I can solve this?
How about removing the blank values with something like,
WHSPEC = WHERE(FINITE(SPEC), CTSPEC)
WHPRES = WHERE(FINITE(PRES), CTPRES)
and so on...
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: autocorrelation with Missing Values [message #60871 is a reply to message #60867] |
Wed, 18 June 2008 04:19  |
matthias.demuzere
Messages: 32 Registered: January 2006
|
Member |
|
|
On Jun 18, 10:26 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Hi,
>
> I would like to perform an autocorrelation with a few missing values
> in the array (I used 'Nan' and blank spaces as missing values). Now,
> If I try the routine a_correlate, the calculated effective degrees of
> freedom results in Nan, and so is also my new correlation coefficient.
>
> Does anybody know how I can solve this?
>
> Thank you!
> Matthias
Oh, and maybe providing the code could be more understanding:
n_Pres_01=n_elements(spec)
lag=1
aauto_Pres_01=a_correlate(spec,lag,/DOUBLE)
bauto_Pres_01=a_correlate(Pres,lag,/DOUBLE)
neff_Pres_01=(n_Pres_01*1.0)/(1.0+(2.0*(aauto_Pres_01*bauto_ Pres_01)))
; calcculate student's t & calculate significance
t_Pres_01=abs(R_Pres_01*sqrt((neff_Pres_01-2.0)/(1.0-
(R_Pres_01^2.0))))
sig_Pres_01=(1-(t_pdf(t_Pres_01,(neff_Pres_01-2.0))))*100.0
if sig_Pres_01 gt 50.0 then sig_Pres_01=(100.0-sig_Pres_01(0))
; need to double as two-tailed test
sig_Pres_01=sig_Pres_01*2.0
Hope that somebody can help me out!
|
|
|