SciML / StochasticDiffEq.jl

Solvers for stochastic differential equations which connect with the scientific machine learning (SciML) ecosystem
Other
245 stars 66 forks source link

Add parameter to allow disabling noise term scaling for BAOAB #520

Closed jebej closed 1 year ago

jebej commented 1 year ago

As discussed in #519, I want to experiment with removing the gamma dependence attached to the noise term for the BAOAB algorithm.

The main issue is that if you do want the gamma dependence, you also need a dependence on dt (coming from the c1 variable in the original code). While this dt dependence could be user-coded in the g noise function, it's not an ideal interface.

Suggestions welcome.

EDIT: instead of removing the scaling wholesale, there is now a scale_noise::Bool argument to BAOAB.

rmsrosa commented 1 year ago

I am not familiar with the method, but browsing the discussions, what about, instead of removing c2, adding another keyword argument to BAOAB() with the option of changing the default behavior?

ChrisRackauckas commented 1 year ago

I just suggested that same thing in another way. I agree it should just have two kwargs.

jebej commented 1 year ago

If we want another keyword argument, the only thing I can think of is something like scale_noise=true, which keeps the current behavior, and when false just sets the c2 variable to 1. Anything else can be handled in the user function.

ChrisRackauckas commented 1 year ago

Or if it's another float, you just make the default c2 = gamma.

ChrisRackauckas commented 1 year ago

Either way is fine I think, but I think the main point is that it needs two args not one.

jebej commented 1 year ago

If we want the original behavior from the paper we need dt:

c1 = exp(-alg.gamma*dt)
c2 = sqrt(1 - c1^2)
ChrisRackauckas commented 1 year ago

It's not already scaling by dt?

jebej commented 1 year ago

From https://doi.org/10.1093/amrx/abs010 (c2 and c3 were switched) image