diffrax
diffrax copied to clipboard
STTLA PR
This PR adds space-time-time Levy area to VirtualBrownianTree and UnsafeBrownianPath. The changes to the overall logic are minor, I mostly just added the math for the space-time-time case.
The additions to test_brownian.py are more extensive:
- In
test_conditional_statisticswe test the pvals of the marginals for W, H, and K separately. This confirms that they are all Gaussian, so their joint distribution is exactly determined by their means and covariances, which we also test for. All of these are conditioned on the sample just before and the one just after the current sample (as it was before). I moved the code for computing the statistics into theconditional_statisticsfunction. - Since the code of
test_conditional_statisticsitself is based on thm 3.7 from the Single-seed paper, I chose to test its correctness from a different angle intest_whk_interpolation. This test tries three things: a) just final interpolation with no halving (brownian bridge) steps, b) only one halving step followed by a final interpolation, c) 15 halving steps (i.e.tol = 2**-15) and no final interpolation (aka. "zero" spline). Since they all have the same distribution as predicted by thm 3.7, I conclude that indeed everything is as it should be. This still relies on the assumption that the halving steps are correct (i.e. thm 3.5), but that was computed by James in his thesis, so I suppose that's a fair assumption :).
In the third commit I added shape annotations to arrays in AbstractBrownianIncrement and its subclasses. This is optional, so if you prefer we can remove this commit.
In the fourth commit I just removed two unnecessary # pyright: ignore comments, so pyright doesn't complain. These have nothing to do with the rest of this PR.
I hope this PR is less challenging to review. No hurry though :)