Apple’s Core Image as a time-​​series data manipulation framework?

One of the early projects I’m con­sid­er­ing under­tak­ing in the new trans­par­ent work­shops we’re start­ing (Coscience​.org and Vague Inno­va­tion, LLC) is a genetic programming-​​based finan­cial port­fo­lio man­age­ment system.

Ten years ago, we devel­oped a pow­er­ful suite of design pat­terns for agent-​​based real-​​time dat­a­min­ing and adap­tive con­trol. We’ve left finance behind in the mean­time, but now and then I find myself lay­ing awake at night think­ing about that neat old system.

You think about some­thing enough, and stuff comes to you. A few days ago a lit­tle 21st-​​century LED light­bulb went off in my head. Maybe because I’m proof­read­ing man­u­scripts from a con­fer­ence I attended a few months ago, where old col­leagues reported pre­lim­i­nary results more or less like what we were expect­ing to see ten years back. Maybe it just takes ten years to put two and two together.

At any rate, what the light­bulb revealed was pretty straight­for­ward: If you have enough pixel bit depth, you could poten­tially treat a 2000-​​entry finan­cial time-series—say for exam­ple stock price ticks—as a 1×2000 pixel image. As it hap­pens, graph­ics pro­cess­ing prim­i­tives (and low-​​level fil­ter rou­tines) are sur­pris­ingly sim­i­lar to the tools used in finan­cial time-​​series analy­sis: aver­ag­ing, phase-​​shifting, smooth­ing, ker­nel meth­ods.… Every­body does it.

The ini­tial pic­ture I saw was pretty sim­ple: Take every minute clos­ing price of every stock in the S&P 500, and plot all that data as a big pix­elmap: hor­i­zon­tal posi­tion is stock (say), ver­ti­cal posi­tion indi­cates time, and color depth is price. Some­thing like that.

Now I woke up a few min­utes ago think­ing about that again after a cou­ple of days, and after a poke or two of the ol’ Google, I find this long-​​suppressed mem­ory crop­ping up:

Core Image Accuracy

Because Core Image uses 32-​​bit float­ing point num­bers instead of fixed scalars, it can han­dle over 1025 col­ors. Each pixel is spec­i­fied by a set of four float­ing point num­bers, one each for the red, green, blue, and alpha com­po­nents of a pixel. This color space is far greater than the human eye can per­ceive. This level of pre­ci­sion in spec­i­fy­ing color com­po­nents allows image fidelity to be pre­served even through a large num­ber of pro­cess­ing steps with­out truncation.

More than that, Core Image offers recipe-​​driven “lazy eval­u­a­tion”, a lan­guage for writ­ing advanced fil­ters and algo­rith­mic trans­for­ma­tions, and par­al­leliza­tion meth­ods built in.

So. That’s enough to make me think.

How about you?

links for 2007-​​08-​​31