Wednesday, October 31, 2012

Listening to your Data

The latest issue of Significance Magazine (a joint publication of the Royal Statistical Society, and the American Statistical Association), includes an interesting article by Ethan Brown and Nick Bearman. It's titled, "Listening to Uncertainty: Information That Sings". 

The article is about "sonification" - listening to your data!
One of the examples that the authors mention will be of interest to those of you who work with time-series data:

"Time series as a waveform
A basic time series process that statisticians might have to study is an autoregression of the second order – which means that each piece of data depends on the piece before it and on the 
piece two places before it as well. There may be random error in the data also. An equation for such a time series is 

                Xt = 0.6165Xt–1 – 0.995Xt–2 + εt  
 Xt is the value of the data at time t, Xt–1 is the value at the time just before it, and Xt–2 at the time two time-intervals before. εt  is the error: it is normally-distributed white noise. We could graph this process but it just looks like a dense mat of points. The structure, however, becomes immediately apparent upon audification. We can listen to this data by picking a small unit of time (say, 0.1 milliseconds) and interpreting the time series as a sequence of sound pressure levels that a computer can play (sound available at soundcloud.com/tnt-yow/fuzz).
When listening, it is immediately audible that there is a persistent pitched tone. Musical pitches are in fact periodic components of sound, so we are hearing that the time series has a periodic component. Part of it repeats over time. It would take complex techniques to show it visually; it is picked up straight away by the ear."
Yes, indeed, when we graph 5,000 values of this stationary time-series (with X1 and X2 both N[0, 1], and the variance of εt set to 1), this is what we see:

I listened to the same data on Soundcloud.com - very interesting. This series really does sound much better than it looks!

I also downloaded and played around with the Sonification Sandbox package that the authors mention on p.17 of their article. Lots of fun, and I can't wait to listen to some non-stationary series!

Perhaps we have new way of model validation in the making?

  • Listen to your dependent variable and the potential covariates.
  • Find a suitably harmonized sub-set of the covariates that's in the same key as your dependent variable.
  • Listen to the predicted series. It should sound at least vaguely familiar!
  • Listen to the residuals series. It should sound like your radio when you can't find a station within range.

I'm sure you get then basic idea!
© 2012, David E. Giles

12 comments:

  1. I can imagine how good Mozart would have been in forecasting!

    ReplyDelete
  2. very interesting!

    ReplyDelete
  3. Perhaps this may be a way of economic forecasting! Have a composer write an orchestral piece, say 'Ode to Wall Street', based on the thematic content of the data, and invest, based on the score.

    In jest, but thanks for a very interesting piece on human perception.

    ReplyDelete
  4. First visualizing your data, now this? Not sure that it passes the smell test. And even if it does, it's not really to my taste.

    (That's a pun, son. You may not want to touch it with a 10 foot pole.)

    ReplyDelete
  5. Doesn't it make more sense to do an FFT? You might pick up more than the primary harmonic and with a bit of easy tweaking do any seasonal type adjustments.

    I agree with marcel though. Make sure it passes the smell test first.

    ReplyDelete
  6. When I was an undergraduate at the UofToronto during the 1970s, I recall that a graduate student was sent to Egypt to collect a data tape that was urgently needed for a professor's research project. After enduring a delayed return, the frustrated professor discovered that the data tape was unreadable. It turned out that the Egyptian authorities insisted on listening to the tape before it was allowed to leave the country.

    ReplyDelete
  7. Or, if you are tone deaf, you could just graph the periodogram like in the old days!

    ReplyDelete
    Replies
    1. Ah yes - the good old frequency domain! Of course, if you're blind but not deaf........

      Delete