MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: computation of autocovariance

  • To: mathgroup at
  • Subject: [mg46190] Re: computation of autocovariance
  • From: Mariusz Jankowski<mjankowski at>
  • Date: Tue, 10 Feb 2004 00:06:08 -0500 (EST)
  • Organization: University of Southern Maine
  • References: <c04ehe$gbr$>
  • Sender: owner-wri-mathgroup at

Paolo, you must define/initialize autoconvS, for example

autoconV = Table[0,{60}].

and then your code should work. However, it is always be better to use
built-in functions. The same should be calculated as follows:

Method 1: if x is not very, very long you can do

tmp = ListCorrelate[x, x, 1, 0];


autoconvS = Take[tmp,60];

Method 2: Best approach is to use (see docs on ListCorrelate) 

autoconvS = ListCorrelate[x, x, {1, Length[x] - 59}, 0]

Bye, Mariusz

>>> paolo<tarpanelli at> 2/7/2004 11:39:10 PM >>>
I am computing the autocovariance, with temporal lags from 1 to 60, of a
time serie but my procedure does not works. 
Can you help me?


    autocovS[[j]]=1/Length[x]-j  + 

when i evaluate the procedure, Mathematica reply

"Part specification autocovS?j? is longer than depth of object."


Paolo Tarpanelli

  • Prev by Date: Re: extracting a list to a list, help please
  • Next by Date: Re: Algebraic Manipulation
  • Previous by thread: computation of autocovariance
  • Next by thread: Re: computation of autocovariance