Sunday, November 6, 2016

Try to beat this python iterator

for pair in convolve(ghraph1,graph2) :
  take_stats(pair.x,pair.y)

x and y are both singletons, you are looking at the statistics of everyone of your singletons matched to everyone of theirs, or not. X and y can be bins, of bounded size.

Convolve can have short cuts., skip block when the bins have order elements.  It the first is out of range, so are the rest.  Hence, it an be very fast, especially for information transfer, if information has an ordering.

The typical use if:
for pair in convolve(hraph1,graph2) :
  red_green += dist(pair.x,pait.y)

Bots do this all day long, getting probability trees from your favorite trading pits, and getting a red/green.  Or it does this looking for sales at Walmart, if Walmart would accept cash.  The fundamental portfolio spreadsheet function, get the probability tree of liquidity events in your portfolio, useful.

No comments: