[09x08] Intro to Bayesian Differential Equations using OrdinaryDiffEq.jl and Turing.jl

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • Differential Equations are great -- if you know the values of the input parameters.
    But, in the real world, you often don't know these values.
    Instead, you have observations, and you need some way to back into the values of the input parameters.
    A Bayesian approach can do just that!
    Take your data.
    Feed it into a Bayesian model.
    And boom!
    The Bayesian model gives you a probability distribution for the input parameters that you're looking for.
    As a motivating example, you'll learn how to use a Bayesian approach to tackle the famous Lotka-Volterra differential equations, also know as the Predator-Prey equations.
    You'll also learn what Retrodiction is, and why you should consider adding it to your Bayesian workflow.
    00:00 Intro
    00:38 Differential Equations
    10:14 Set-up
    12:20 Data
    14:46 OrdinaryDiffEq.jl
    17:00 Turing.jl
    25:34 Retrodiction
    30:15 Outro
    ##############################
    Links for this tutorial
    ##############################
    Data for this tutorial
    url = "raw.githubusercontent.com/jul..."
    Code for this tutorial (GitHub)
    github.com/julia4ta/tutorials...
    Turing.jl Tutorials. "Bayesian Estimation of Differential Equations."
    turinglang.org/dev/tutorials/...
    SciML. DiffEqBayes.jl Documentation. "Bayesian Inference of ODE."
    docs.sciml.ai/DiffEqBayes/sta...
    Rackauckas, Chris. "A Comparison Between Differential Equations Solver Suites In MATLAB, R, Julia, Python, C, Mathematica, Maple, and Fortran." www.stochasticlifestyle.com. 2017.
    www.stochasticlifestyle.com/c...
    doggo dot jl. "[07x08] Solve System of Differential Equations in Julia using DifferentialEquations.jl and Pluto". 2022. (CZcams)
    • [07x08] Solve System o...
    doggo dot jl. Playlist. "Tutorial Series 07 | Julia Differential Equations for Beginners." 2022.
    • Tutorial Series 07 | J...
    ##############################
    Links for this series
    ##############################
    Link to Series 9 Playlist [Julia Probabilistic Programming for Beginners]
    • [09x01] How Much of Ea...
    Turing.jl Documentation
    turinglang.org/stable/docs/us...
    Turing.jl (GitHub)
    github.com/TuringLang/Turing.jl
    Turing.jl Website
    turinglang.org/stable/
    StatsPlots.jl Documentation
    docs.juliaplots.org/latest/ge...
    StatsPlots.jl (GitHub)
    github.com/JuliaPlots/StatsPl...
    Distributions.jl Documentation
    juliastats.org/Distributions....
    Distributions.jl (GitHub)
    github.com/JuliaStats/Distrib...
    The Julia Programming Language
    julialang.org/
    docs.julialang.org/en/v1/
    / @thejulialanguage
    VS Code
    code.visualstudio.com/
    Pluto.jl
    plutojl.org/
    github.com/fonsp/Pluto.jl
    ##############################
    Join Button (Channel Membership):
    If you like what I do, then please consider Joining and becoming a Channel Member.
    / @doggodotjl
    Thank you!
  • Věda a technologie

Komentáře • 18

  • @user-km2qu3is2n
    @user-km2qu3is2n Před rokem +1

    Thank you for your teaching👌🔥🔥🔥

  • @siddharthyadav2120
    @siddharthyadav2120 Před rokem +1

    I am soo glad I found this channel. Simple and concise language with the cute doggo in the background. Love your work man. Keep it up. Will be more than happy buy your Udemy course (if you decide to make one!). Cheers.

    • @doggodotjl
      @doggodotjl  Před rokem

      Thanks for the kind words, and thanks for watching!

  • @carlsoderberg5355
    @carlsoderberg5355 Před rokem +2

    Great video! I have been thinking about combining Turing and DiffEqs...and suddenly this video appears! Thank you!

  • @doggodotjl
    @doggodotjl  Před rokem +3

    For ongoing support, please consider Joining and becoming a Channel Member:
    czcams.com/channels/QwQVlIkbalDzmMnr-0tRhw.htmljoin
    Thank you!

    • @Stopinvadingmyhardware
      @Stopinvadingmyhardware Před rokem

      Can we see some Quantum Physics stuff?

    • @doggodotjl
      @doggodotjl  Před rokem +1

      @@Stopinvadingmyhardware Thank you for your suggestion. I have to confess that I don't currently have any knowledge of Quantum Physics, but I am interested in the subject, so I will put it on my "to do" list for a possible future video. Thanks!

  • @TheKyprosGaming
    @TheKyprosGaming Před měsícem

    The end Scared me 🤣

  • @irisallevi6414
    @irisallevi6414 Před rokem +2

    Thank you for these amazing videos! I'm loving this series on Probabilistic Programming. I learned a lot more than in class.
    May I ask you a very stupid question? How do you generate automatically your titles with comments in VSCode files?

    • @doggodotjl
      @doggodotjl  Před rokem

      I'm cheating, lol! I'm copying and pasting those comment blocks from a different text file that I have off-screen (don't tell anyone!).😁

    • @irisallevi6414
      @irisallevi6414 Před rokem

      @@doggodotjl Hahahah ok 😄

  • @Fabi100295
    @Fabi100295 Před rokem

    Thank you very much again for the very good video!!
    Often times, the parameters of a ODE model are identified using an optimization based approach by minimizing some kind of RMSE. What is the difference in this approach compared to the "traditional" optimization based approach? I would assume that the uncertainty on the parameters is better expressed through a distribution. Would you always recommend the bayesian approach over a non-bayesian traditional model fitting?

    • @doggodotjl
      @doggodotjl  Před rokem

      Whether you use a Bayesian approach or not really depends on your situation. It's really just another tool to have in your tool kit.

  • @berntlie6799
    @berntlie6799 Před rokem

    Super good, as always.
    --
    Suppose one has an "input time series" of data, say foxes killed by hunting as a function of time, or releasing rabbits raised on a farm into nature as a function of time.
    To solve the ODE then, one needs to create an interpolation function of the input data and include in the differential equation.
    Question: for Turing to handle this, is it ok to choose any type of interpolation function? ("zero order hold"/piecewise constant, etc.), or should the interpolation function be differentiable in time (in case Turing calculates some Jacobian when computing the chain)?
    --
    Do you plan to do an example with Stochastic DEs with Turing? That would be cool, too.

    • @doggodotjl
      @doggodotjl  Před rokem +1

      Wow, these are really interesting questions. I have to confess that I am out of my depth here as this is beyond my knowledge. I do have a tutorial on Stochastic DEs on this channel, but it did not include any Bayesian inference. Again, I have to confess that I don't currently know how to do that. I'll add it to my to do list for a possible future video. Thanks for the question and feedback!

    • @berntlie6799
      @berntlie6799 Před rokem

      @@doggodotjl OK... (1) I'll see if I can create an example of the rabbit-fox example with hunting, etc.. I have an example with a DAE (different problem) with input function and with model fitting in Turing , where Turing takes "forever" with lots of garbage collection, and I'm wondering if there is a problem if the input function is not differentiable.
      (2) Stochastic DE... I played around with a measles infection model 3 years ago. I fitted a deterministic SIR model to the data, but it would be interesting to consider a stochastic model.
      Anyways, I could dig up a couple of cases if you are interested. I'm on vacation right now, so I would need a little time to do so.