Skip to content

Add saveat keyword argument #214

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

Open
albertomercurio opened this issue Feb 13, 2025 · 4 comments
Open

Add saveat keyword argument #214

albertomercurio opened this issue Feb 13, 2025 · 4 comments

Comments

@albertomercurio
Copy link

Is your feature request related to a problem? Please describe.

The functions currently support the save_every_step keyword argument. This saves a Vector that can be more or less long. A saveat kwarg would be useful in such cases an SDE uses saveat and we want to extract the noise process only on that times, without necessary allocating memory for saving the entire process history.

Describe the solution you’d like

An additional keyword argument on all the AbstractNoiseProcesses, or at least starting with the WienerProcess and RealWienerProcess.

Describe alternatives you’ve considered

Just preallocating an empty vector, and updating it as long as the process evolves.

@ChrisRackauckas
Copy link
Member

I agree it should be added. Just haven't gotten to it.

@albertomercurio
Copy link
Author

Hello, do you think it is something easy to implement? Do you have a temporary workaround?

Moreover, it is a bit off-topic, but also related to this. Is there a direct way to extract the derivative of the noise $d W / d t$?

@ChrisRackauckas
Copy link
Member

It wouldn't be difficult. You'd just add in https://github.com/SciML/DiffEqNoiseProcess.jl/blob/master/src/solve.jl#L28 something that checks through the saveat array and interpolates back. So you basically do this https://github.com/SciML/SimpleDiffEq.jl/blob/master/src/tsit5/gpuatsit5.jl#L67-L76, but for noise processes the interpolation is trivial because it's linear and already built into the type, so you'd just add something like that.

Is there a direct way to extract the derivative of the noise

That's undefined a.e.

@ChrisRackauckas
Copy link
Member

Let me know if you plan to take a stab at it. It shouldn't take more than an hour. The main thing is writing test cases.

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

No branches or pull requests

2 participants