Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vectorize scenario generation, add LOTS of tests #53

Merged
merged 11 commits into from
May 23, 2020

Conversation

jason-ash
Copy link
Owner

Working on #50 to try to speed up scenario generation.

@jason-ash jason-ash linked an issue May 21, 2020 that may be closed by this pull request
@jason-ash
Copy link
Owner Author

Rebased onto master at b9a042b

@jason-ash
Copy link
Owner Author

Pretty impressive performance 🏎️ !

It takes 0.16 seconds to generate 10,000 scenarios with 252 timesteps each using the BlackScholesProcess.

Python 3.6.7 |Anaconda custom (64-bit)| (default, Dec 10 2018, 20:35:02) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from pyesg import BlackScholesProcess

In [2]: model = BlackScholesProcess.example()

In [3]: %timeit model.scenarios(100.0, dt=1/252, n_scenarios=10000, n_steps=252, random_state=42)
164 ms ± 1.02 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

@jason-ash jason-ash changed the title vectorize scenario generation vectorize scenario generation, add LOTS of tests May 22, 2020
@jason-ash
Copy link
Owner Author

Rebase onto master at f67da1e

@jason-ash jason-ash marked this pull request as ready for review May 23, 2020 05:28
@jason-ash jason-ash merged commit 6062cff into master May 23, 2020
@jason-ash jason-ash deleted the vectorize-scenarios branch May 23, 2020 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallelize stochastic process
1 participant