{"id":16499267,"url":"https://github.com/mschauer/mitosisstochasticdiffeq.jl","last_synced_at":"2025-03-01T18:15:16.607Z","repository":{"id":44594612,"uuid":"303703804","full_name":"mschauer/MitosisStochasticDiffEq.jl","owner":"mschauer","description":"Backward-filtering forward-guiding with StochasticDiffEq.jl","archived":false,"fork":false,"pushed_at":"2024-02-23T15:15:09.000Z","size":2356,"stargazers_count":12,"open_issues_count":10,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-20T20:24:14.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mschauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-13T12:58:07.000Z","updated_at":"2024-09-10T14:00:45.000Z","dependencies_parsed_at":"2025-01-13T14:57:07.712Z","dependency_job_id":null,"html_url":"https://github.com/mschauer/MitosisStochasticDiffEq.jl","commit_stats":{"total_commits":192,"total_committers":6,"mean_commits":32.0,"dds":"0.44791666666666663","last_synced_commit":"ec0717ea161de124e549fe918e59c263bb3f5435"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschauer%2FMitosisStochasticDiffEq.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschauer%2FMitosisStochasticDiffEq.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschauer%2FMitosisStochasticDiffEq.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschauer%2FMitosisStochasticDiffEq.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mschauer","download_url":"https://codeload.github.com/mschauer/MitosisStochasticDiffEq.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241404416,"owners_count":19957655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T14:51:46.438Z","updated_at":"2025-03-01T18:15:16.572Z","avatar_url":"https://github.com/mschauer.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MitosisStochasticDiffEq.jl\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://mschauer.github.io/MitosisStochasticDiffEq.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://mschauer.github.io/MitosisStochasticDiffEq.jl/dev)\n[![Build Status](https://github.com/mschauer/MitosisStochasticDiffEq.jl/workflows/CI/badge.svg)](https://github.com/mschauer/MitosisStochasticDiffEq.jl/actions)\n\nImplements the [Mitosis transformation rules](https://github.com/mschauer/Mitosis.jl) `backwardfilter` and `forwardguiding` for SciML's [`StochasticDiffEq`](https://github.com/SciML/StochasticDiffEq.jl) problems.\n\nIf the (possibly non-linear) drift depends linearly on parameters, estimate the parameters from continuous observations by `regression`.\n\n[![MitosisStochasticDiffEq.jl - Filtering \u0026 Guiding for SDEs | Frank Schäfer | JuliaCon2021E](https://img.youtube.com/vi/rie7MTvPpIs/0.jpg)](https://www.youtube.com/watch?v=rie7MTvPpIs)\n \n## Synopsis\n\n*MitosisStochasticDiffEq* implements the backward filter and the forward change of measure  of the Automatic Backward Filtering Forward Guiding paradigm  (van der Meulen and Schauer, 2020) as transformation rules for SDE models,  suitable to be incorporated into probabilistic programming approaches.\n\nIn particular, this package implements the equations ... of section 9.1, [2] further detailed in [1]. The recursion for the quantity c in [1, Theorem 3.3 (Information filter)] is replaced by the simpler rule from [2, Example 10.8.]\n\n## Show reel\n\n### Bayesian regression on the drift parameter of an SDE\n```julia\nusing StochasticDiffEq\nusing Random\nusing MitosisStochasticDiffEq\nimport MitosisStochasticDiffEq as MSDE\nusing LinearAlgebra, Statistics\n\n# Model and sensitivity\nfunction f(du, u, θ, t)\n    c = 0.2 * θ\n    du[1] = -0.1 * u[1] + c * u[2]\n    du[2] = - c * u[1] - 0.1 * u[2]\n    return\nend\nfunction g(du, u, θ, t)\n    fill!(du, 0.15)\n    return\nend\n\n# b is linear in the parameter with Jacobian\nfunction b_jac(J,x,θ,t)\n    J .= false\n    J[1,1] =   0.2 * x[2]\n    J[2,1] = - 0.2 * x[1]\n    nothing\nend\n# and intercept\nfunction b_icpt(dx,x,θ,t)\n    dx .= false\n    dx[1] = -0.1 * x[1]\n    dx[2] = -0.1 * x[2]\n    nothing\nend\n\n# Simulate path ensemble\nx0 = [1.0, 1.0]\ntspan = (0.0, 20.0)\nθ0 = 1.0\ndt = 0.05\nt = range(tspan...; step=dt)\n\nprob = SDEProblem{true}(f, g, x0, tspan, θ0)\nensembleprob = EnsembleProblem(prob)\nensemblesol = solve(\n    ensembleprob, EM(), EnsembleThreads(); dt=dt, saveat=t, trajectories=1000\n)\n\n# Inference on drift parameters\nsdekernel = MSDE.SDEKernel(f,g,t,0*θ0)\nϕprototype = zeros((length(x0),length(θ0))) # prototypes for vectors\nyprototype = zeros((length(x0),))\nR = MSDE.Regression!(sdekernel,yprototype,paramjac_prototype=ϕprototype,paramjac=b_jac,intercept=b_icpt)\nprior_precision = 0.1I(1)\nposterior = MSDE.conjugate(R, ensemblesol, prior_precision)\nprint(mean(posterior)[], \" ± \", sqrt(cov(posterior)[]))\n```\n\n\n## References\n\n* [1] Marcin Mider, Moritz Schauer, Frank van der Meulen (2020): Continuous-discrete smoothing of diffusions. [[arxiv:1712.03807]](https://arxiv.org/abs/arxiv:1712.03807).\n* [2] Frank van der Meulen, Moritz Schauer (2020): Automatic Backward Filtering Forward Guiding for Markov processes and graphical models. [[arXiv:2010.03509]](https://arxiv.org/abs/2010.03509).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschauer%2Fmitosisstochasticdiffeq.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmschauer%2Fmitosisstochasticdiffeq.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschauer%2Fmitosisstochasticdiffeq.jl/lists"}