views:

254

answers:

5

The question sort of says it all.

Whether it's for code testing purposes, or you're modeling a real-world process, or you're trying to impress a loved one, what are some algorithms that folks use to generate interesting time series data? Are there any good resources out there with a consolidated list? No constraints on values (except plus or minus infinity) or dimensions, but I'm looking for examples that people have found useful or exciting in practice.

Bonus points for parsimonious and readable code samples.

+2  A: 

Don't have an answer for the algorithm part but you can see how "realistic" your data is with Benford's law

DShook
A: 

@Hazar

Not an answer, but I'll give it a point for the fun video behind that link. It's not mentioned there, but Benford's Law is a result of the preponderance of more-or-less logarithmically distributed data occurring in nature. More at Wikipedia.

Adam Hollidge
+2  A: 

There are a ton of PRN generators out there, and you can always get free random bits, or even buy them on CD or DVD.

I've used simple sine wave generators mixed together with some phase and amplitude noise thrown in to get signals that sound and look interesting to humans when put through speakers or lights, but I don't know what you mean by interesting.

There are ways to generate data that looks interesting in a chart form, but that would be different than data used on a stock chart, and neither would make a nice "static" image such as produced by an analog television tuned to a null channel.

You can use Conway's game of life as a PRN, and "listen" to cells (or run all the cells through a logic circuit) to get some interesting time based signals.

It would be interesting to look at the graph of DB updates/inserts for Stackoverflow over time, and you could mine that data.

There really are infinite ways to generate an "interesting" time series data. Can you narrow the scope of your question?

Adam Davis
A: 

@Adam Davis

Can you narrow the scope of your question?

I wanted to cast a wide net. Much of the value of Stackoverflow comes from its high serendipity quotient. I was just trying to maximize the probability of finding something useful but unexpected.

Adam Hollidge
+2  A: 

Try the kind of recurrences that can give variously simple or chaotic series based on the part of their phase spaces you explore: the simplest I can think of is the logistic map x(n+1) = r * x(n) * ( 1 - x(n) ). With r approx. 3.57 you get chaotic results that depend on the initial point.

If you graph this versus time you can get lots of different series just by manipulating that parameter r. If you were to graph it as x(n+1) v. x(n) without connecting dots, you see a simple parabola take shape over time.

This is one of the most basic functions from chaos theory and trying more interesting polynomials, graphing them as x(n+1) v. x(n) and watching a shape form, and then graphing x(n) v. n is a fun and interesting way to create series.

Graphing x(n+1) v. x(n) makes it quickly obvious if you're only visiting a small number of points. Deeper recurrences become more interesting as well, and using different values of x(0) to check on sensitivity to initial conditions is also of interest.

But for simplicity, control by a single parameter, and ability to find something to read about your recurrence, it'll be hard to beat the logistic map.

I recommend: http://en.wikipedia.org/wiki/Logistic_map. It has a nice description of what to expect from different values of r.

Thomas Kammeyer