Calculating Autocorrelations for Large Data Sets in Excel: Tips and Alternatives

Click For Summary

Discussion Overview

The discussion revolves around calculating autocorrelations for a large set of equi-spaced data points using Excel, as well as exploring alternative software options for performing these calculations. Participants share methods, tools, and suggestions for handling the computational challenges associated with large data sets.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant seeks to calculate autocorrelations for 9,999 data points in Excel but encounters issues with formula translation when extending calculations for multiple lags.
  • Another participant suggests using Python with numpy and scipy as an alternative, highlighting its capabilities for scripting and plotting.
  • A different method using the OFFSET function in Excel is proposed to calculate autocorrelations without needing to extend the original formula.
  • Concerns are raised about Excel's performance with large calculations, prompting a request for guidance on creating a correlogram in Mathematica.
  • Additional software alternatives such as FreeMat, Scilab, Octave, and Python are mentioned as potential tools for similar tasks.

Areas of Agreement / Disagreement

Participants express varying levels of familiarity with different software tools, and while some methods are shared and appreciated, there is no consensus on a single best approach for calculating autocorrelations or creating correlograms.

Contextual Notes

Participants note limitations in Excel's handling of large data sets and the absence of VB Macros in Excel 2008 for Mac, which may affect the proposed solutions.

MichalXC
Messages
39
Reaction score
0
I have a set of 9,999 equi-spaced data points, and I would like to calculate the autocorrelations for ALL lags up to 5,000.

In Excel, I want to have this code:

=CORREL(B1:B9998,B2:B9999)
=CORREL(B1:B9997,B3:B9999)
=CORREL(B1:B9996,B4:B9999)
...
=CORREL(B1:B5000,B5000:B9999)

Unfortunately, the formula does not "translate" nicely when I extend it downwards.

Also I have Excel 2008 for Mac, which does not handle VB Macros.

Can anyone direct me? Or suggest a better way of doing it? I don't have MatLab, but I do have Mathematica.

Thanks in advance.
 
Computer science news on Phys.org
Well, I am going to suggest Python, but only because you thought of Matlab, in the first place...which shows that you might be inclined to some scripting.

Actually, there is FreeMat which is an a-la-matlab application.

But also, there is Python with its numpy and scipy (scipy.stats) modules you can do anything you want and plot it right away with matplotlib.

...just a thought
 
Try:
=CORREL(OFFSET($B$1, 0, 0, 9999-A1, 1 ),OFFSET($B$1, A1, 0, 9999-A1, 1 ))
=CORREL(OFFSET($B$1, 0, 0, 9999-A2, 1 ),OFFSET($B$1, A2, 0, 9999-A2, 1 ))

after you have filled column A with the consecutive row numbers (1, 2, 3, ...)
 
Gsal, sorry, I don't know Python.

The above-posted formula works great though!

Thanks, both, for your replies!
 
Glad to be of help! :smile:
 
Hi again.

Excel (understandably) becomes unresponsive when asked to do some of these calculations. Seeing as much, I would be most grateful if someone could show me how to implement a correlogram (autocorrelation plot) in Mathematica.
 
since you mentioned MATLAB (deja vu?), another program you might want to check out is Scilab. not a full clone, but very similar to matlab.
 
Then, there is Octave and Freemat. And of course, Python with numpy/scipy.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
10K
  • · Replies 9 ·
Replies
9
Views
3K