Fix GBM demo replication statistics and speed up the Gaussian transform - #585
Fix GBM demo replication statistics and speed up the Gaussian transform#585larissensium wants to merge 354 commits into
Conversation
…tware/QMCSoftware into geometric_brownian_motion
…tware/QMCSoftware into geometric_brownian_motion
* Initial plan * Add error log capture and display in parsl_test_runner.py Co-authored-by: sou-cheng-choi <18743024+sou-cheng-choi@users.noreply.github.com> * Simplify error logging by removing redundant stderr checks Co-authored-by: sou-cheng-choi <18743024+sou-cheng-choi@users.noreply.github.com> * Add error handling for log file reading operations Co-authored-by: sou-cheng-choi <18743024+sou-cheng-choi@users.noreply.github.com> --------- Co-authored-by: alegresor <agsorokin3@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sou-cheng-choi <18743024+sou-cheng-choi@users.noreply.github.com>
JiangruiKang
left a comment
There was a problem hiding this comment.
The switch to Burley scrambling is the right way to obtain independent randomized-QMC replications, but one reproducibility defect remains at dimensions above the Jaeckel table. The current tests are green because they use n_steps=4; please cover the 32/33-dimensional boundary before merging.
| # Jaeckel direction integers, so changing its `seed` does not create an | ||
| # independent replication. Burley2020SobolRsg applies a seeded Owen-style | ||
| # scramble; keep the underlying Sobol seed fixed and vary the scramble. | ||
| uniform_rsg = ql.Burley2020SobolRsg(dimension, 0, ql.SobolRsg.Jaeckel, seed) |
There was a problem hiding this comment.
[P2] Use a fixed nonzero underlying Sobol seed
QuantLib treats this second argument differently from the replication-specific scramble seed. Jaeckel direction integers are tabulated only through dimension 32; above that, SobolRsg uses this value to generate additional direction integers, and QuantLib defines 0 as a clock-selected random seed. Consequently, two calls with the same public seed can produce different paths when n_steps >= 33 (see lballabio/QuantLib#2732), even though the comment says the underlying seed is fixed. Please use a fixed nonzero value such as 42, vary only scrambleSeed, and add a regression test at n_steps=33 showing that equal scramble seeds reproduce exactly while different scramble seeds remain distinct.
|
Thank you for your invaluable suggestion. I have implemented the changes with a unit test @larissensium , @alegresor and @JiangruiKang : Summary of changes:
|
…tware/qmcpy into geometric_brownian_motion
|
|
||
| def _transform(self, x): | ||
| return self.mu + np.einsum("...ij,kj->...ik", norm.ppf(x), self.a) | ||
| transformed = ndtri(x) @ self.a.T |
There was a problem hiding this comment.
Nice change! Haven't heard of this ndtri before, but it is suppose to be much faster than norm.ppf
|
Thanks! |
Fixed a table in gbm_demo to correctly show results averaged over replications.