JumpProcesses

Build and simulate jump equations like Gillespie simulations and jump diffusions with constant and state-dependent rates and mix with differential equations and scientific machine learning (SciML)

https://github.com/sciml/jumpprocesses.jl

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    4 of 38 committers (10.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

differential-equations gillespie hybrid-differential-equation jump-diffusion neural-differential-equations neural-ode ode scientific-ai scientific-machine-learning scientific-ml sciml sde ssa stochastic stochastic-jump-equations

Keywords from Contributors

pde differentialequations dae dde stochastic-differential-equations ordinary-differential-equations partial-differential-equations delay-differential-equations numerical matrix-exponential
Last synced: 6 months ago · JSON representation

Repository

Build and simulate jump equations like Gillespie simulations and jump diffusions with constant and state-dependent rates and mix with differential equations and scientific machine learning (SciML)

Basic Info
Statistics
  • Stars: 144
  • Watchers: 9
  • Forks: 38
  • Open Issues: 79
  • Releases: 147
Topics
differential-equations gillespie hybrid-differential-equation jump-diffusion neural-differential-equations neural-ode ode scientific-ai scientific-machine-learning scientific-ml sciml sde ssa stochastic stochastic-jump-equations
Created about 9 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

JumpProcesses.jl

Stable Release Docs Master Branch Docs DOI

Build Status ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

JumpProcesses.jl provides methods for simulating jump processes, known as stochastic simulation algorithms (SSAs), Doob's method, Gillespie methods, or Kinetic Monte Carlo methods across different fields of science. It also enables the incorporation of jump processes into hybrid jump-ODE and jump-SDE models, including piecewise deterministic Markov processes (PDMPs) and jump diffusions.

JumpProcesses is a component package in the SciML ecosystem, and one of the core solver libraries included in DifferentialEquations.jl.

For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation which contains unreleased features.

The documentation includes

Contributions welcomed!

Contact us in sciml-bridged on Slack to discuss where to get started, the Help wanted issue, or just open a PR to address an open issue or add new functionality. Contributions, no matter how small, are always welcome and appreciated, including documentation editing/writing. See also the contribution section.

Installation

There are two ways to install JumpProcesses.jl. First, users may install the meta DifferentialEquations.jl package, which installs and wraps OrdinaryDiffEq.jl for solving ODEs, StochasticDiffEq.jl for solving SDEs, and JumpProcesses.jl, along with a number of other useful packages for solving models involving ODEs, SDEs and/or jump process. This single install will provide the user with all of the facilities for developing and solving Jump problems.

To install the DifferentialEquations.jl package, refer to the following link for complete installation details.

If the user wishes to separately install the JumpProcesses.jl library, which is a lighter dependency than DifferentialEquations.jl, then the following code will install JumpProcesses.jl using the Julia package manager:

julia using Pkg Pkg.add("JumpProcesses")

Examples

Stochastic Chemical Kinetics SIR Model

Here we consider the stochastic chemical kinetics jump process model for the basic SIR model, involving three species, $(S,I,R)$, that can undergo the reactions $S + I \to 2I$ and $I \to R$ (each represented as a jump process)

```julia using JumpProcesses, Plots

here we order S = 1, I = 2, and R = 3

substrate stoichiometry:

substoich = [[1 => 1, 2 => 1], # 1S + 1I [2 => 1]] # 1*I

net change by each jump type

netstoich = [[1 => -1, 2 => 1], # S -> S-1, I -> I+1 [2 => -1, 3 => 1]] # I -> I-1, R -> R+1

rate constants for each jump

p = (0.1 / 1000, 0.01)

p[1] is rate for S+I --> 2I, p[2] for I --> R

pidxs = [1, 2]

maj = MassActionJump(substoich, netstoich; param_idxs = pidxs)

u = [999, 1, 0] #[S(0),I(0),R(0)] tspan = (0.0, 250.0) dprob = DiscreteProblem(u, tspan, p)

use the Direct method to simulate

jprob = JumpProblem(dprob, maj)

solve as a pure jump process, i.e. using SSAStepper

sol = solve(jprob) plot(sol) ```

SIR Model

Instead of MassActionJump, we could have used the less efficient, but more flexible, ConstantRateJump type

```julia rate1(u, p, t) = p[1] * u[1] * u[2] # p[1]SI function affect1!(integrator) integrator.u[1] -= 1 # S -> S - 1 integrator.u[2] += 1 # I -> I + 1 end jump = ConstantRateJump(rate1, affect1!)

rate2(u, p, t) = p[2] * u[2] # p[2]*I function affect2!(integrator) integrator.u[2] -= 1 # I -> I - 1 integrator.u[3] += 1 # R -> R + 1 end jump2 = ConstantRateJump(rate2, affect2!) jprob = JumpProblem(dprob, jump, jump2) sol = solve(jprob) ```

Jump-ODE Example

Let's solve an ODE for exponential growth, but coupled to a constant rate jump (Poisson) process that halves the solution each time it fires

```julia using DifferentialEquations, Plots

du/dt = u is the ODE part

function f(du, u, p, t) du[1] = u[1] end u = [0.2] tspan = (0.0, 10.0) prob = ODEProblem(f, u, tspan)

jump part

fires with a constant intensity of 2

rate(u, p, t) = 2

halve the solution when firing

affect!(integrator) = (integrator.u[1] = integrator.u[1] / 2) jump = ConstantRateJump(rate, affect!)

use the Direct method to handle simulating the jumps

jump_prob = JumpProblem(prob, Direct(), jump)

now couple to the ODE, solving the ODE with the Tsit5 method

sol = solve(jump_prob, Tsit5()) plot(sol) ```

constant_rate_jump

Contributing and Getting Help

Owner

  • Name: SciML Open Source Scientific Machine Learning
  • Login: SciML
  • Kind: organization
  • Email: contact@chrisrackauckas.com

Open source software for scientific machine learning

GitHub Events

Total
  • Create event: 20
  • Release event: 8
  • Issues event: 30
  • Watch event: 4
  • Delete event: 10
  • Issue comment event: 108
  • Push event: 103
  • Pull request event: 56
  • Pull request review comment event: 183
  • Pull request review event: 162
  • Fork event: 4
Last Year
  • Create event: 20
  • Release event: 8
  • Issues event: 30
  • Watch event: 4
  • Delete event: 10
  • Issue comment event: 108
  • Push event: 103
  • Pull request event: 56
  • Pull request review comment event: 183
  • Pull request review event: 162
  • Fork event: 4

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 1,264
  • Total Committers: 38
  • Avg Commits per committer: 33.263
  • Development Distribution Score (DDS): 0.623
Past Year
  • Commits: 147
  • Committers: 9
  • Avg Commits per committer: 16.333
  • Development Distribution Score (DDS): 0.299
Top Committers
Name Email Commits
Sam Isaacson i****s 477
Vasily Ilin v****7@g****m 244
Christopher Rackauckas a****s@c****m 241
gzagatti g****i 122
vyudu v****n@g****m 33
Arno Strouwen a****n@t****e 18
alanderos91 a****s@u****u 15
github-actions[bot] 4****] 12
elevien e****n@g****m 12
dependabot[bot] 4****] 11
Manuel Reinhardt m****t@g****m 10
Arnav Sood 5****s 8
Torkel t****n@g****m 8
Anant Thazhemadam a****m@g****m 6
Christopher Johnstone m****0@g****m 6
CompatHelper Julia c****y@j****g 6
David Widmann d****b@d****e 5
krishna bhogaonker c****q@g****m 4
oscarddssmith o****h@j****m 3
Chris de Graaf me@c****v 2
Guillaume Dalle 2****e 2
Yingbo Ma m****5@g****m 2
Aayush Sabharwal a****l@j****m 2
femtocleaner[bot] f****] 1
Pepijn de Vos p****s@j****m 1
xiaoming p****3@1****m 1
Tatsuhiro Onodera o****t@s****u 1
ScottPJones s****s@a****u 1
Sathvik Bhagavan s****n@g****m 1
Pietro Monticone 3****e 1
and 8 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 103
  • Total pull requests: 208
  • Average time to close issues: 6 months
  • Average time to close pull requests: 17 days
  • Total issue authors: 34
  • Total pull request authors: 27
  • Average comments per issue: 5.67
  • Average comments per pull request: 2.12
  • Merged pull requests: 164
  • Bot issues: 0
  • Bot pull requests: 33
Past Year
  • Issues: 24
  • Pull requests: 56
  • Average time to close issues: 21 days
  • Average time to close pull requests: 9 days
  • Issue authors: 8
  • Pull request authors: 9
  • Average comments per issue: 1.5
  • Average comments per pull request: 1.48
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 9
Top Authors
Issue Authors
  • isaacsas (41)
  • TorkelE (10)
  • ChrisRackauckas (9)
  • Vilin97 (6)
  • gdalle (4)
  • gaurav-arya (4)
  • damienBloch (2)
  • kaandocal (2)
  • gzagatti (1)
  • lmshk (1)
  • meson800 (1)
  • calebrich (1)
  • hurak (1)
  • sebapersson (1)
  • ArnoStrouwen (1)
Pull Request Authors
  • isaacsas (82)
  • ChrisRackauckas (25)
  • gzagatti (22)
  • github-actions[bot] (22)
  • ArnoStrouwen (18)
  • Vilin97 (17)
  • dependabot[bot] (16)
  • sivasathyaseeelan (11)
  • thazhemadam (6)
  • AayushSabharwal (5)
  • oscardssmith (4)
  • gdalle (3)
  • vyudu (2)
  • meson800 (2)
  • gaurav-arya (1)
Top Labels
Issue Labels
bug (18) help wanted (3) first issue (2) question (1)
Pull Request Labels
dependencies (16) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 5,019 total
  • Total dependent packages: 9
  • Total dependent repositories: 0
  • Total versions: 48
juliahub.com: JumpProcesses

Build and simulate jump equations like Gillespie simulations and jump diffusions with constant and state-dependent rates and mix with differential equations and scientific machine learning (SciML)

  • Versions: 48
  • Dependent Packages: 9
  • Dependent Repositories: 0
  • Downloads: 5,019 Total
Rankings
Forks count: 6.0%
Stargazers count: 6.8%
Average: 7.6%
Dependent packages count: 7.6%
Dependent repos count: 9.9%
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • coverallsapp/github-action master composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
  • julia-actions/setup-julia latest composite
.github/workflows/Documentation.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/setup-julia latest composite
.github/workflows/FormatCheck.yml actions
  • actions/checkout v1 composite
  • julia-actions/setup-julia latest composite
.github/workflows/Invalidations.yml actions
  • actions/checkout v3 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-invalidations v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite