Message Boards Message Boards

The Monkey function does not work: AbsoluteCorrelationFunction

Posted 10 years ago

As an ocasssional user of Mathematica, my preferred function is the 'Monkey' function. It consists of copying the specific Input from the help documentation and inserting my personal data. I did it with the AbsoluteCorrelationFunction but I failed and I dont know why. I created the following simple cells (Hint, filename.txt contains 130000 numbers)

  • In[1]:= Data = Import["path\filename.txt", "Table"]
  • In[2]:=r = AbsoluteCorrelationFunction[data, {1, 10000,1}] (I followed the specification given for hspec)
  • In[3]:=Plot[r, {1, 10000}, AxesOrigin -> {0, 0}, PlotRange -> All]

But Mathematica answered

  • lot::pllim: "Range specification {1,10000} is not of the form {x, xmin, xmax}.

Where is my 'x'? Alternatively, I might be interested in exporting the autocorrelation function into an output file: two columns, lag and acf data. How can I do this? I would greatly appreciate a comment or help

POSTED BY: Juan Bselga
2 Replies

Assuming that your data was imported into the correct format for AbsoluteCorrelationFunction, then AbsoluteCorrelationFunction is returning a list of data. So you'd need to use ListPlot. Plot is for functions or an explicit variable, hence the error message. E.g., your Listplot call would be

ListPlot[r, AxesOrigin -> {0, 0}, PlotRange -> All]

without your specific data I cannot be sure this will work, but give it a try.

POSTED BY: David Reiss
Posted 10 years ago

Thanks a lot. It seems working.


POSTED BY: Juan Bselga
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract