All Projects → mschauer → Bridge.jl

mschauer / Bridge.jl

Licence: other
A statistical toolbox for diffusion processes and stochastic differential equations. Named after the Brownian Bridge.

Programming Languages

Jupyter Notebook
11667 projects
julia
2034 projects
r
7636 projects

Projects that are alternatives of or similar to Bridge.jl

Gpstuff
GPstuff - Gaussian process models for Bayesian analysis
Stars: ✭ 106 (+7.07%)
Mutual labels:  bayesian-inference, mcmc
diffeqr
Solving differential equations in R using DifferentialEquations.jl and the SciML Scientific Machine Learning ecosystem
Stars: ✭ 118 (+19.19%)
Mutual labels:  sde, stochastic-differential-equations
Exoplanet
Fast & scalable MCMC for all your exoplanet needs!
Stars: ✭ 122 (+23.23%)
Mutual labels:  bayesian-inference, mcmc
Bat.jl
A Bayesian Analysis Toolkit in Julia
Stars: ✭ 82 (-17.17%)
Mutual labels:  bayesian-inference, mcmc
KramersMoyal
kramersmoyal: Kramers-Moyal coefficients for stochastic data of any dimension, to any desired order
Stars: ✭ 53 (-46.46%)
Mutual labels:  stochastic-differential-equations, diffusion
Paramonte
ParaMonte: Plain Powerful Parallel Monte Carlo and MCMC Library for Python, MATLAB, Fortran, C++, C.
Stars: ✭ 88 (-11.11%)
Mutual labels:  bayesian-inference, mcmc
SCICoNE
Single-cell copy number calling and event history reconstruction.
Stars: ✭ 20 (-79.8%)
Mutual labels:  bayesian-inference, mcmc
Bda py demos
Bayesian Data Analysis demos for Python
Stars: ✭ 781 (+688.89%)
Mutual labels:  bayesian-inference, mcmc
Mcmc
Collection of Monte Carlo (MC) and Markov Chain Monte Carlo (MCMC) algorithms applied on simple examples.
Stars: ✭ 218 (+120.2%)
Mutual labels:  bayesian-inference, mcmc
Probabilistic Models
Collection of probabilistic models and inference algorithms
Stars: ✭ 217 (+119.19%)
Mutual labels:  bayesian-inference, mcmc
Turing.jl
Bayesian inference with probabilistic programming.
Stars: ✭ 1,150 (+1061.62%)
Mutual labels:  bayesian-inference, mcmc
webmc3
A web interface for exploring PyMC3 traces
Stars: ✭ 46 (-53.54%)
Mutual labels:  bayesian-inference, mcmc
Dblink
Distributed Bayesian Entity Resolution in Apache Spark
Stars: ✭ 38 (-61.62%)
Mutual labels:  bayesian-inference, mcmc
Nimble
The base NIMBLE package for R
Stars: ✭ 95 (-4.04%)
Mutual labels:  bayesian-inference, mcmc
Bayesian Neural Networks
Pytorch implementations of Bayes By Backprop, MC Dropout, SGLD, the Local Reparametrization Trick, KF-Laplace, SG-HMC and more
Stars: ✭ 900 (+809.09%)
Mutual labels:  bayesian-inference, mcmc
Beast2
Bayesian Evolutionary Analysis by Sampling Trees
Stars: ✭ 156 (+57.58%)
Mutual labels:  bayesian-inference, mcmc
Pymc3
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara
Stars: ✭ 6,214 (+6176.77%)
Mutual labels:  bayesian-inference, mcmc
Rstan
RStan, the R interface to Stan
Stars: ✭ 760 (+667.68%)
Mutual labels:  bayesian-inference, mcmc
Shinystan
shinystan R package and ShinyStan GUI
Stars: ✭ 172 (+73.74%)
Mutual labels:  bayesian-inference, mcmc
pysgmcmc
Bayesian Deep Learning with Stochastic Gradient MCMC Methods
Stars: ✭ 31 (-68.69%)
Mutual labels:  bayesian-inference, mcmc

Build Status Latest Latest

Logo

Bridge.jl

Statistics and stochastic calculus for Markov processes in continuous time, include univariate and multivariate stochastic processes such as stochastic differential equations or diffusions (SDE's) or Levy processes.

I am personally interested in doing Bayesian inference on discretely observed diffusion processes, but this package is written to be of general use and contributions are welcome. Specifically for our code for parameter inference for diffusion processes from discrete data or passage times, check out the dependent package BridgeSDEInference.jl. The statistical method relies a lot on simulating conditional diffusions (so called "difffusion bridges"). See ./example/tutorial.jl for a more general introduction into working with this package.

  • Define and simulate diffusion processes in one or more dimension
  • Continuous and discrete likelihood using Girsanovs theorem and transition densities
  • Monte Carlo sample diffusion bridges, diffusion processes conditioned to hit a point v at a prescribed time T
  • Brownian motion in one and more dimensions
  • Ornstein-Uhlenbeck processes and Ornstein-Uhlenbeck bridges
  • Bessel processes
  • Gamma processes
  • Inhomogenous poisson process
  • Basic stochastic calculus functionality (Ito integral, quadratic variation)
  • Euler-Scheme and implicit methods (Runge-Kutta)
  • Levy-driven SDEs
  • Continuous-discrete filtering for partially observed diffusion processes

The layout/api was originally written to be compatible with Simon Danisch's package FixedSizeArrays.jl. It was refactored to be compatible with StaticArrays.jl by Dan Getz. Some SDE and ODE solvers in Bridge are accessible with the JuliaDiffEq common interface via BridgeDiffEq.jl.

The example programs in the example/ directory have additional dependencies: ConjugatePriors and a plotting library.

Introduction

The key objects introduced are the abstract type ContinuousTimeProcess{T} parametrised by the state space of the path, for example T == Float64 and various structs suptyping it, for example Wiener{Float64} for a real Brownian motion. These play roughly a similar role as types subtyping Distribution in the Distributions.jl package.

Secondly, the struct

struct SamplePath{T}
    tt::Vector{Float64}
    yy::Vector{T}
    SamplePath{T}(tt, yy) where {T} = new(tt, yy)
end

serves as container for sample path returned by direct and approximate samplers (sample, euler, ...). tt is the vector of the grid points of the simulation and yy the corresponding vector of states.

Help is available at the REPL:

help?> GammaProcess
search: GammaProcess LocalGammaProcess VarianceGammaProcess
GammaProcess

A GammaProcess with jump rate γ and inverse jump size λ has increments Gamma(t*γ, 1/λ) and Levy measure

ν(x) = γ x⁻¹ exp(-λ x),

Here Gamma(α,θ) is the Gamma distribution in julia's parametrization with shape parameter α and scale θ.

Examples

julia> sample(linspace(0.0, 1.0), GammaProcess(1.0, 0.5))

Pre-defined processes defined are Wiener, WienerBridge, Gamma, LinPro (linear diffusion/generalized Ornstein-Uhlenbeck) and others.

It is also quite transparent how to add a new process:

using Bridge
using Plots

# Define a diffusion process
struct OrnsteinUhlenbeck  <: ContinuousTimeProcess{Float64}
    β::Float64 # drift parameter (also known as inverse relaxation time)
    σ::Float64 # diffusion parameter
end

# define drift and diffusion coefficient of OrnsteinUhlenbeck
Bridge.b(t, x, P::OrnsteinUhlenbeck) = -P.β*x
Bridge.σ(t, x, P::OrnsteinUhlenbeck) = P.σ

# simulate OrnsteinUhlenbeck using Euler scheme
W = sample(0:0.01:10, Wiener())
X = solve(EulerMaruyama(), 0.1, W, OrnsteinUhlenbeck(2.0, 1.0))
plot(X, label="X")

OrnsteinUhlenbeck

# Levy (Difference-Gamma process) driven OrnsteinUhlenbeck
Z = sample(0:0.01:10, GammaProcess(100.0,10.0))
Z.yy .-= sample(0:0.01:10, GammaProcess(100.0,10.0)).yy
Y = solve(EulerMaruyama(), 0.1, Z, OrnsteinUhlenbeck(2.0, 1.0))
plot(Y, label="Y")

Levy OrnsteinUhlenbeck

Feedback and Contributing

See the documentation for more functionality and issue #12 (Feedback and Contribution) for coordination of the development. Bridge is free software under the MIT licence. If you use Bridge.jl in a closed environment I’d be happy to hear about your use case in a mail to [email protected] and able to give some support.

Literature

F. v. d. Meulen, M. Schauer: Bayesian estimation of discretely observed multi-dimensional diffusion processes using guided proposals. Electronic Journal of Statistics 11 (1), 2017, doi:10.1214/17-EJS1290.

M. Schauer, F. v. d. Meulen, H. v. Zanten: Guided proposals for simulating multi-dimensional diffusion bridges. Bernoulli 23 (4A), 2017, doi:10.3150/16-BEJ833.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].