3
$\begingroup$

I have to deal with time series to find some patterns there. The method selected is SAX (based on PAA).

There's a built-in function to convert a numeric times series into a series of letters with a specific length and alphabet in R: http://rug.mnhn.fr/seewave/HTML/MAN/SAX.html And AFAIK, there's no such function in Wolfram Mathematica.

So, my question is: what is the simplest way to implement SAX in WM? Which functions in which combinations do I use to apply this operation to a time series?

update

More info on transformations:

$\endgroup$
3
  • 2
    $\begingroup$ Can you explain the conversion through an example for those of us not familiar with SAX? $\endgroup$
    – Szabolcs
    Commented Nov 16, 2016 at 12:16
  • $\begingroup$ Sorry, I've updated the question. $\endgroup$ Commented Nov 16, 2016 at 13:08
  • $\begingroup$ Look like MovingAverage can be applied in the PAA algorithm. $\endgroup$
    – corey979
    Commented Nov 16, 2016 at 13:30

1 Answer 1

4
$\begingroup$

Well, I managed it by myself.

...
normalized = Standardize[data];
size = 100;
quantile = N[1/26];
quantiles = Table[Quantile[normalized, i], {i, 0, 1, quantile}];
paa = TimeSeriesAggregate[normalized, size];
sax = Table[
      Alphabet[][[FirstPosition[quantiles, 
           SelectFirst[quantiles, # > paa[[i]] &]][[1]] - 1]], {i, 1, 
       Length[paa]}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.