math.extras: adding the Kelly criterion.
parent
ea2547aae3
commit
a4c0ae98c5
|
@ -157,3 +157,7 @@ IN: math.extras.test
|
|||
} [
|
||||
30 [1,b] [ mobius ] map
|
||||
] unit-test
|
||||
|
||||
{ 0.2 } [ 0.6 1 kelly ] unit-test
|
||||
{ 0.0 } [ 0.5 1 kelly ] unit-test
|
||||
{ -0.2 } [ 0.4 1 kelly ] unit-test
|
||||
|
|
|
@ -322,3 +322,6 @@ M: iota-tuple sum-cubes sum sq ;
|
|||
dup [ 1 > ] any?
|
||||
[ drop 0 ] [ length even? 1 -1 ? ] if
|
||||
] if-empty ;
|
||||
|
||||
: kelly ( winning-probability odds -- fraction )
|
||||
[ 1 + * 1 - ] [ / ] bi ;
|
||||
|
|
Loading…
Reference in New Issue