Skip to content
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

Differential Equations #1

Open
cscherrer opened this issue Jan 7, 2018 · 8 comments
Open

Differential Equations #1

cscherrer opened this issue Jan 7, 2018 · 8 comments

Comments

@cscherrer
Copy link
Owner

Implement SDE, etc using DifferentialEquations.jl and (most likely) Stan-like approach

@ChrisRackauckas
Copy link

You probably don't want to take on the dependency, so we are building integration with the different backends into DiffEqBayes.jl. If you have some starter code that would be great!

@cscherrer
Copy link
Owner Author

I don't understand how Soss could work as a backend. Can you tell me more about what you have in mind?

Soss can call any Julia code, so a model could have any DiffEq code as part of it. But I'm open to other ideas

@ChrisRackauckas
Copy link

Soss can call any Julia code, so a model could have any DiffEq code as part of it. But I'm open to other ideas

Yes, but that would require learning Soss or knowing Bayesian stats. The point of DiffEqBayes is to make the integration automatic, like with Stan:

bayesian_result = stan_inference(prob1,t,data,priors)

you give it an ODE, the time points with data, the data points, and a collection of priors, and it spits out chains. The problem is structured enough that it's clear exactly what the model should be (or parameters for things like likelihood distribution). There's a Stan and a Turing backend with the same interface.

@cscherrer
Copy link
Owner Author

Oh, guess I need to look at how they do this. There must be a Stan model specified somewhere, is this just fixed? Does it make sense to have the same model every time?

@ChrisRackauckas
Copy link

Does it make sense to have the same model every time?

Yes.

There must be a Stan model specified somewhere, is this just fixed?

It interpolates in the differential equation, time points, data, and priors. The rest is fixed.

https://github.com/JuliaDiffEq/DiffEqBayes.jl/blob/master/src/stan_inference.jl#L51-L83

@cscherrer
Copy link
Owner Author

Oh interesting. Yeah that should be pretty easy I think. I was going to say you could write it just as easily by hand, but Soss will eventually make it easier to do things like Posterior predictive checks (described as part of #9).

So... Translate the Stan model you gave, then do Stan-like inference and send you the resulting code?

@ChrisRackauckas
Copy link

That would be great.

@cscherrer
Copy link
Owner Author

Ok cool. Translating is easy. I broke the logdensity function in changing the interface all around, but it will be working again soon. A bit tougher is inference, which requires gradients (probably via XGrad) and NUTS or a similar sampler (eventually DynamicHMC, but I might use the one I wrote temporarily until that but is connected).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants