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

Feedback and Contributing #12

Open
mschauer opened this issue Sep 11, 2017 · 4 comments
Open

Feedback and Contributing #12

mschauer opened this issue Sep 11, 2017 · 4 comments

Comments

@mschauer
Copy link
Owner

This issue is held open for general feedback, feature requests and to coordinate contributions to the package; or just to say "hello".

@getzdan
Copy link
Contributor

getzdan commented Sep 11, 2017

"hello" (sorry couldn't help it)

@sdwfrost
Copy link

Hi @mschauer

I'm trying to port this example to Bridge.jl. Can I check that the noise term is correct (ie matching my other example)?

function Bridge.σ(t, u, P::SIR)
    (S,I,R) = u
    N = S + I + R
    ifrac = P.β*P.c*I/N*S
    rfrac = P.γ*I
    return @SMatrix Float64[
     sqrt(ifrac)      0.0
    -sqrt(ifrac)  -sqrt(rfrac)
     0.0   sqrt(rfrac)
    ]
end

or do I need to remove the square roots?

In my StochasticDiffEq example, sometimes the states go below zero, so I have a callback to stop the solver then. Is there something comparable in Bridge.jl? I can run a single run, but the benchmark current fails because of this.

Any tips on parameter inference using Bridge.jl when data is the cumulative number of cases (see here) would be great, and would allow me to add another example.

Full gist so far here

@mschauer
Copy link
Owner Author

Bridge doesn't support callbacks. I would just simulate and reject simulated trajectories which become negative, for that to work, you can use sqrt(abs(ifrac)) to avoid triggering an error message.
But can we reparametrize the SDE by using Ito's formula on log(X(t))? That would be convenient from a statistical point of view swell.

I can give you an example for inference from the cumulative number of cases, perhaps using https://github.com/mschauer/MitosisStochasticDiffEq.jl with @frankschae because that is what we are currently working on/working with.

@sdwfrost
Copy link

Thanks @mschauer. I have a reparameterization from Fintzi et al. that transforms to consider log(X(t)+1), but your workaround (which is obvious now that you mention it) is great for now.

https://github.com/epirecipes/sir-julia/blob/master/markdown/mbp/mbp.md

Thanks for the pointer to Mitosis.jl!

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

3 participants