• Stars
    star
    35
  • Rank 726,005 (Top 15 %)
  • Language
    Julia
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatic probabilistic programming for scientific machine learning and dynamical models

Dev Build Status

Mitosis.jl (work in progress)

Incorporate discrete and continuous time Markov processes as building blocks into probabilistic graphical models.

Synopsis

Mitosis 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 general generative models, suitable to be incorporated into probabilistic programming approaches.

Starting point is the generative model, a forward description of the probabilistic process dynamics. The backward filter backpropagate the information provided by observations through the model to transform the generative (forward) model into a preconditional model guided by the data.

The preconditional model approximates the actual conditional model, with known likelihood-ratio between the two and can be used in a variety of sampling and statistical inference approaches to speed up inference.

Overview

This package will contain the general infrastructure and the rules for non-linear Gaussian transition kernels, thus allowing non-linear state space models.

In parallel, rules for stochastic differential equations are developed in MitosisStochasticDiffEq.jl

Show reel

Bayesian regression on the drift parameter of an SDE

using StochasticDiffEq
using Random
using MitosisStochasticDiffEq
import MitosisStochasticDiffEq as MSDE
using LinearAlgebra, Statistics

# Model and sensitivity
function f(du, u, θ, t)
    c = 0.2 * θ
    du[1] = -0.1 * u[1] + c * u[2]
    du[2] = - c * u[1] - 0.1 * u[2]
    return
end
function g(du, u, θ, t)
    fill!(du, 0.15)
    return
end

# b is linear in the parameter with Jacobian 
function b_jac(J,x,θ,t)
    J .= false
    J[1,1] =   0.2 * x[2] 
    J[2,1] = - 0.2 * x[1]
    nothing
end
# and intercept
function b_icpt(dx,x,θ,t)
    dx .= false
    dx[1] = -0.1 * x[1]
    dx[2] = -0.1 * x[2]
    nothing
end

# Simulate path ensemble 
x0 = [1.0, 1.0]
tspan = (0.0, 20.0)
θ0 = 1.0
dt = 0.05
t = range(tspan...; step=dt)

prob = SDEProblem{true}(f, g, x0, tspan, θ0)
ensembleprob = EnsembleProblem(prob)
ensemblesol = solve(
    ensembleprob, EM(), EnsembleThreads(); dt=dt, saveat=t, trajectories=1000
)

# Inference on drift parameters
sdekernel = MSDE.SDEKernel(f,g,t,0*θ0)
ϕprototype = zeros((length(x0),length(θ0))) # prototypes for vectors
yprototype = zeros((length(x0),))
R = MSDE.Regression!(sdekernel,yprototype,paramjac_prototype=ϕprototype,paramjac=b_jac,intercept=b_icpt)
prior_precision = 0.1I(1)
posterior = MSDE.conjugate(R, ensemblesol, prior_precision)
print(mean(posterior)[], " ± ", sqrt(cov(posterior)[]))

References

  • Frank van der Meulen, Moritz Schauer (2020): Automatic Backward Filtering Forward Guiding for Markov processes and graphical models. [arXiv:2010.03509].

More Repositories

1

CausalInference.jl

Causal inference, graphical models and structure learning in Julia
Julia
183
star
2

Bridge.jl

A statistical toolbox for diffusion processes and stochastic differential equations. Named after the Brownian Bridge.
Jupyter Notebook
111
star
3

ZigZagBoomerang.jl

Sleek implementations of the ZigZag, Boomerang and other assorted piecewise deterministic Markov processes for Markov Chain Monte Carlo including Sticky PDMPs for variable selection
Julia
95
star
4

Kalman.jl

Flexible filtering and smoothing in Julia
Julia
72
star
5

DynamicIterators.jl

Iterators with message passing and feedback loops
Julia
21
star
6

GaussianDistributions.jl

Gaussian distributions as state variables and for uncertainty quantification with Unitful
Julia
17
star
7

GoldenSequences.jl

Generalized golden sequences, a form of low discrepancy sequence or quasi random numbers
Julia
17
star
8

MitosisStochasticDiffEq.jl

Backward-filtering forward-guiding with StochasticDiffEq.jl
Julia
11
star
9

PointProcessInference.jl

Statistical inference for Poisson Processes
Julia
7
star
10

MicrostructureNoise.jl

Nonparametric Bayesian volatility learning under microstructure noise
Jupyter Notebook
7
star
11

Trajectories.jl

Maps from the line into spaces
Julia
6
star
12

IDRsSolver.jl

++ incorporated into https://github.com/JuliaLang/IterativeSolvers.jl ++ Induced Dimension Reduction method IDR(s) for solving general non-symmetric linear equations using a Krylov method, for example ordinary linear equations or Sylvester and Stein equations.
Julia
6
star
13

BridgeLandmarks.jl

Image analysis and stochastic processes on shape and landmark spaces.
Julia
4
star
14

BayesEstDiffusion.jl

Code accompanying the paper Frank van der Meulen, Moritz Schauer: Bayesian estimation of discretely observed multi-dimensional diffusion processes using guided proposals
Julia
4
star
15

SDE.jl

This package is obsoleted by https://github.com/mschauer/Bridge.jl
Julia
3
star
16

nonparbayes

Tour through non-parametric Bayesian regression in Fourier domain using Julia https://mschauer.github.io/nonparbayes/
HTML
3
star
17

BridgeSPDE.jl

Stochastic partial differential equations with Bridge.jl
Julia
3
star
18

StructuresSeminar

Statistics for Structures Seminar
HTML
2
star
19

Schauder.jl

A graphical perspective on Gauss-Markov process priors and fast sparse Cholesky for hierarchically structured (generalized arrow) matrices
Julia
2
star
20

FingerTrees.jl

The persistent data structure Finger Tree in Julia
Julia
1
star