Archive for the '3d' Category

Levenshtein and Distance Between Strings in 3D

Working on the strings distances, or text metrics, I found out the Levenshtein method insufficient. For less-than-similar strings it doesn’t help at all, giving numbers close to max possible, and for similar strings it does not consider the quality of different letters. Generally speaking, I find Janet1 closer to Janet2 than to Janet9. Or ABC closer to BBC than to NBC. The notion of number of operations in Lev method didn’t quite suit me either. Thinking of operations needed to create one string of the other, I’d rather take the count of smartest possible copy&paste moves. In other words, how many times I have to cut one string to make the other of the slices. That would be distance in first dimension. The other – distance between letters replacing each other: when abc becomes bbc, it’s a-b replacement, and distance from a to b is 1. The distance depends on the alphabet used. For some cases it’s more useful to use a keyboard-layout order of characters instead of usual alphabetic, in order to emphasise similarities based on easy typed sequences, like asdf or qwerty. Here’s some Flash demo, calculator and benchmark to compare performance of Levenshtein and my method.

3d position of the words

it depends on their similarity to the word you input
Sorry, either Adobe flash is not installed or you do not have it enabled


Similarity calculator

gives the original Levenshtein and the distance3d figures

Sorry, either Adobe flash is not installed or you do not have it enabled


Benchmarking

Levenshtein is rather quadratic, while distance3d seems more like linear, though the
difference shows up for words longer than 15 characters.

Sorry, either Adobe flash is not installed or you do not have it enabled


Market Data Perspective

Here is the first post in English, as its target is perhaps a bit wider than for my usual gibberish.

The nine month now work for Symagon GmBH (subsidiary of Nagler & Company) has its fruit. Or even a few. The first and what took the most effort is a Flex GUI for investment strategy backtesting and market data review. This was done with Rafał Sytek from Symagon. Backend is kdb+, a vector-oriented, fast database which I know little about ;) and a little Java/Blaze DS middleware. The second is a 3D visualisation tool for order book series. The 3D tool is only a little ‘Flexish’. The main 3D component is a pure Actionscript thing, with layers, 3D-2D and back transformations, etc. And here is what I find cool enough to show off.

This type of visualisation is simpler and closer to the common chart.

This type of visualisation is simpler and closer to the common chart.

The plane beneath the chosen order book helps you compare bid and ask sides.

The plane beneath the chosen order book helps you compare bid and ask sides.

Clicking on a order book strip gets you to the details of single orders.

Clicking on a order book strip gets you to the details of single orders.

Almost a hundred of order books visualised as 3d slope

Almost a hundred of order books in a row

An order book is a snapshot of a market, with (almost) all buy and sell offers for a single financial instrument. I pictured a series of order books as a sloped river bank, with the transaction at water’s level. The ground above is a cumulated size of ask orders beginning from the transaction. The green part is going deeper as the bid orders cumulate. Time axis is horizontal, and Y-axis shows price levels. I believe this visualisation gives a lot more information in a simple manner. Now looking forward to the expert opinion… see what is coming.

Backtesting GUI

This was a good lesson. Series renderers, chart extensions, live scrolling, zooming, syncing between the charts show the real flex guts. Sometimes I felt like writing it from the scratch myself… It was not anything about Flex itself, rather my understanding the complexity of its components. As it turned out, it was usually better to study a bit more the originals rather than implementing one’s own solutions. Some of the comps developed at the beginning look completely naive and weird now. The motto of future Flex chart works is:

ChartElement class is essential to almost all you.

And the big application for testing investment strategies looks like this:

Adobe AIR/Flex frontend of an application for testing investment strategies

Adobe AIR/Flex frontend of an application for testing investment strategies