I want to generate fake data for use in testing a graphing library (highcharts in this case, but it doesn’t really matter). I’d like to generate random data on each click that looks like it might actually be real data in a line chart, for example.
What that means to me is that the naive approach of just a series of (X+1, rand()) doesn’t work. It wouldn’t fool anyone most of the time.
Are there approaches that will look like “real data” but can be generated over and over to produce different shapes that look “real”. Sorry for being vague, it’s sort of a “I know it when I see it” kind of thing.
What I’m looking for is an algorithm, not a particular language implementation. Ruby and/or javascript is what I’d be using most likely, though.
You can use Midpoint Displacement like its described here
In this algorithm you start with a few random points and then compute small height offsets between these points.
Its often used for 2D Terrain generation in computer games.