On Dec 3, 7:20=A0am, "Thomas Clark" <t.cl...@remove.spamcantab.net>
wrote:
> Let's think about a hypothetical example where you'd have that kind of da=
ta... recording brownian motion.
>
> So, I'm not a big physicist, but let's take brownian motion: Drop a light=
particle onto a water surface. Observe it's x,y position on the surface ov=
er time; it'll jitter around with some 'random' motion, which will give a d=
ata set similar to yours.
>
> A few different ways of analysing that, let's look at one example:
> Say we want to see whether there is any coherent motion toward the y dire=
ction over time (this is your 'similarity metric' mentioned above). Basical=
ly, we want to plot a histogram. Instead of the normal histogram (the bell=
curve 2D plot that you might get if you look at the MATLAB help page for hi=
st() function), we want one which varies in 2 directions, y and t, with the=
z axis indicating the frequency with which the particle lies at a given y=
position during a given timeframe.
>
> This is where the previous poster's 'bins' comment is applicable. You nee=
d a grid, where each point in the grid represents a bin. Say t varies betwe=
en 0 and 1000 seconds, and y varies between 20 and 20 mm:
>
> % A code snippet:
> y_bins =3D 19:2:19;
> t_bins =3D 50:100:950;
>
> ... gives you 20 bins in the y direction (e.g. the first bin spans y_bins=
(1)1 to y_bins(1)+1 ), 10 bins in the t direction (first bin spans t_bins(=
1)50 to t_bins(1)+50 ). Your zcoordinate of the 3D histogram should be a =
20 by 10 array.
>
> Each element of this array corresponds to one y bin and one t bin; For ea=
ch element of the array, count how many times in your datasets that the par=
ticle is in the y bin AND in the t bin corresponding to this element. Store=
the total number in that element.
>
> Assuming you've called your zelements array 'Z', type:
> surf(Z)
>
> and you plot a 3D histogram. You can adjust the x and y axes either manua=
lly or by creating X and Y matrices (see the meshgrid command) and inputtin=
g them to the surf command... see help(surf) and help(meshgrid) for this.
>
> If your surface plot turns out spiky, with no particular pattern; then th=
ere is no correlation between time and the y position. You have truly rando=
m data.
>
> If it turns out to be a smooth hump; you're able to see a trend... in the=
example of brownian motion (correct me if I'm wrong, physicists), you'd se=
e a hump in the y direction, centred on y =3D 0 (because the particle jitte=
rs about it's original position); but no correlation over time (so you'd se=
e the same hump in each time bin).
>
> AAAaaannnnnddd.... I'm done.
>
> Hope this helps
>
> Tom Clark

If Brownian motion is like a random walk, then this is an interesting
situation. I, probably like most people, once thought that if you add
a random number between 1 and +1 to a number, then the average value
(location) will stay the same after many, many hundreds of
iterations. It may drift away but eventually will drift back, and
you'd get a symmetrical distribution. However it's not true. It will
wander away from the starting point indefinitely (forever) with only
minor backtracks due to randomness. There's a bunch of math
describing this phenomenon. For example,
http://en.wikipedia.org/wiki/Random_walk
http://www.statisticshelponline.com/node48.html
The stock market people have fun with this  basis for all kinds of
predictions (google it).
(It's sometimes also called the drunkard's path or walk)
Just a fun aside . . . . . . .
Regards,
ImageAnalyst
