jmholzer / probabilistic

Generate probability curves for the future price of publicly traded securities using options chain data.
3 stars 1 forks source link

reduced number of points for TVR by factor of 10 #28

Closed tyrneh closed 1 year ago

tyrneh commented 1 year ago

TVR algorithm takes a long time on 2500 points, so reducing it to 250 exponentially speeds up runtime.

jmholzer commented 1 year ago

Nice work, this fixes our problem 🚀!. It would be interesting to do a time complexity analysis of the implementation of TVR differentiation we are using.

I added two commits to the PR:

  1. As it stood, the length of X_sparse was 250, the length of y was 251, which caused an error when trying to create a plot, I fixed this by returning y[len(X_sparse)] instead of y. This is the same strategy as before, though we used a magic number (2500) to fix the length of y; this is a bit more robust.
  2. I removed the magic number (2500) from the call to pyplot.scatter in graphics.matplot_grapher.py.