google-research / torchsde

Differentiable SDE solvers with GPU support and efficient sensitivity analysis.
Apache License 2.0
1.52k stars 195 forks source link

BInterval - U fix #44

Closed patrick-kidger closed 3 years ago

patrick-kidger commented 3 years ago

I've ran all the tests and all the diagnostics and everything LGTM. Sorry this took so long, getting the tests working proved surprisingly finickity.

I've not added any tests for A, basically because I don't see any sensible options for doing so. We can't check consistency, i.e. is

\int_s^t W^1_{s,u} dW^2_u = \int_s^v W^1_{s,u} dW^2_u + \int_v^t W^1_{s,v} dW^2_u + \int_v^t W^1_{v,u} dW^2_u

true [or rather the antisymmetric version of this] because we're not trying to satisfy this condition anyway. Davie-Foster corrections are generated on each subinterval independently. Moreover it's not clear that generating one on one subinterval, and then calculating the other, will produce the correct behaviour on the second subinterval, as these are only approximations.

We can't check for distribution, because the distribution of A is unknown.

We could independently implement the calculation we're already doing, and see if both approximations match. Worth doing do you think?

lxuechen commented 3 years ago

Thanks for the fix! Apart from a few minor issues, the code looks good.

Since the Foster approximation generates normals, we should be able to do conditioning. One potentially easy way I can think of at the moment is to just do conditioning for the standard Gaussians used to generate the additional noise. Conditioning is then just the usual Brownian bridge. We could discuss this further in a later PR.

patrick-kidger commented 3 years ago

Hmm, perhaps I need to think more about Levy area. Let's defer that to a later PR though, agreed.