Saturday, October 24, 2009

Progress on Kelly materials

Not done is nothing taught me a lesson. Publicly saying "I didn't complete this because I lost interest" doesn't feel good and provides motivation to finish. So I've returned to the Kelly Criterion explanation I was working on, added a little bit, and provided return calculator that optimizes.

That may not sound like much, but under the hood it is doing calculus in JavaScript. The generic parts of the implementation are in advanced-math.js. If you like the idea of doing math with closures, feel free to take a look.

Next I need to add some linear algebra, some multi-variable calculus, then implement something that finds maxima using Newton's method on a convex polytope defined in any number of dimensions using a set of linear inequalities. You can think of this as a non-linear version of the problem solved by the Simplex Algorithm. The fun part is that I need it to good enough to find the optimum point in an n-dimensional polytope sitting in n+1-dimensional space. (The actual polytope I will need is defined by 0 ≤ xi &le 1 for i=0..n, and x0 + ... + xn = 1.) That means I have to deal with issues like finding my way back to the region after round-off error takes me away from it.

Oh. And of course I'll do all of this in JavaScript.

Perhaps that can be useful for others? Possibly. However JavaScript has no real equivalent to, say, CPAN, so the effort of putting it somewhere that someone in need can easily find it is beyond my motivation. That's why I did nothing with my port of Statistics::Distributions. But that is a thought for another day.

2 comments:

  1. Your link http://elem.com/~btilly/kelly-criterion/ should be
    http://elem.com/~btilly/kelly_criterion/

    ReplyDelete
  2. Thanks for catching that. I've just made both versions of the URL work instead.

    ReplyDelete