sn248 / sundialr

R Interface to CVODE/CVODES/IDA functions in the SUNDIALS ODE solving C library
Other
10 stars 4 forks source link

adjoint sensitivities #4

Open oyvfos opened 5 years ago

oyvfos commented 5 years ago

Hi, great work! Any plans to add adjoint sensitivities? Kr, oyvind?

sn248 commented 5 years ago

Hi Oyvind

Yes, it is on my to-do list, after

You want to get a crack on it? I can help!

S. Nayak

oyvfos commented 5 years ago

Hi Satya, I am interested. But I now realize that the current version does not support spatial discretization (see cvAdvDiff_bnd.c). This I need for my application (Hull White PDE). Maybe I can start with that ? What is your developing environment ? I am using windows. Is there a minimal developing environement? Can I use inline Rcpp for instance? Kr, Oyvind

sn248 commented 5 years ago

Hi Oyvind

Yes, please start with cvAdvDiff_bnd.c, that looks like a plan. Windows is fine, we do have to check on all the environments CRAN supports to get accepted there. I am using Rcpp, although not the inline function. I will take a look at cvAdvDiff_bnd.c to see if it needs anything else from SUNDIALS which is not included in the package src directory yet.

Thanks! Satya

oyvfos commented 5 years ago

Hi, I am set up. Didnt know that Rstudio came with an IDE. Is there a branch we can cooparate on? Did you have any structure in mind? Kr, Oyvind

oyvfos commented 5 years ago

Hi Satya, I suggest restricting the set-up to a convection-diffusion form of the PDE. I will use cvAdvDiff_bnd.c as a template. In addition to the current input of cvode also a space vector, coefficients a,b,c and d have to be submitted by the user. These parameters and the ic needs to be functions of t and x. See https://developers.opengamma.com/quantitative-research/numerical-solutions-to-pdes-with-financial-applications-opengamma.pdf for a reference. Can you help with this?

sn248 commented 5 years ago

Hi Ovyfos

Thanks for the reference. I will take a look at cvAdvDiff_bnd.c. I might be able to implement it in the package.

Satya