0

I've been looking for fortran code for computing the autocorrelation function like R's acf function. The code I have found so far uses some parameter called the dimension of correlation. I am used to seeing autocorrelation in terms of lag. What is the relationship between the dimension and the lag? Or am I mixing up two different types/concepts of autocorrelation?

UPDATE So it does just look like an issue of semantics---at least, for this implementation. I got thrown off by this implementation, which seems to be doing something entirely different.

Richard Hardy
  • 67,272
mikeck
  • 205
  • Programmers can call their variables anything they like, subject to the lexical requirements of the language. – whuber Nov 05 '16 at 21:48
  • Thanks @whuber---so you suspect it's just semantics? Have you seen the term "dimension" used to refer to lag? – mikeck Nov 06 '16 at 01:47
  • Experience has taught me to infer little from the names programmers give to their variables. Sometimes they can be misleading. Using "dimension" for lag would be strange--and it would be awful in a Fortran program, too, because of the special role of that word in the language. Fortunately, I don't see anything in either of your links that calls any variable "dimension". I really can't tell what you might be referring to by this word. – whuber Nov 06 '16 at 15:38
  • @whuber, in the first link the author describes the variable M as the "dimension" in the post text. In the second link, my exploration of the context for the variable nmolecules (which I assumed was a shortcut to allow autocorrelation for multiple variables, rather than having to call the function multiple times) which led me to discussions of autocorrelation between molecular spins and the term correlation dimension was used. I still don't understand what the code in the second link is doing, but the first link matches results in R. – mikeck Nov 06 '16 at 19:11
  • The second link appears to compute the autocorrelation function, or "acf." – whuber Nov 06 '16 at 20:36

0 Answers0