Fast parameter inference for discrete state space continuous time (DSSCT) models in R.

Please note that this package is still in development.

Discuit is a package for Bayesian inference in Discrete state space continuous time (DSSCT) models. DSSCT models, sometimes referred to as compartmental models, are used to represent systems where individuals are assumed, usually as a simplifying abstraction, to move between discrete states. They are a well established research tool in fields including physics, chemistry and ecology. Their use in scientific research typically involves the challenge of comparing ‘noisy’ experimental or observational data to the unobserved (i.e. latent) underlying processes described by the model. Bayes’ theorem provides a convenient framework for dealing with uncertainty in the data. The Bayesian framework also provide a natural, methodologically consistent way of incorporating existing scientific knowledge of the system; the prior distribution of the model parameters

The augmented data Markov chain Monte Carlo (MCMC) methods implemented in Discuit work by introducing a latent variable \(\xi\), which represents the sequence of events in a single realisation of the model, to the model likelihood function of model parameters \(\theta\) given a set observations \(y\):

\(\pi(\theta|y) = \pi(y|\xi) \pi(\xi|\theta) \pi(\theta)\)

The Discuit.jl package contains tools for parameter inference and simulation of discrete state space continuous time (DSSCT) models in Julia. The Discuit package for R makes use of the JuliaCall package to expose the functionality of Discuit.jl within the R environment. See Introduction to MCMC for a basic introduction to MCMC and Introduction to Monte Carlo methods for an overview of random sampling generally.

The Discuit examples article gives an overview of the package functionality. Automated tools for analysis and convergence diagnostics include autocorrelation, the Geweke test of stationarity and the Gelman-Rubin diagnostic for multiple Markov chains (a convenient way to run analyses where more than one processor thread is available for use). Simulation via the Gillespie direct method provides a source of simulated observations data for evaluation and validation of the core inference functionality. See the Discuit models section for a guide to the pre defined model library and the reference manual for a description of types and functions.

Features

  • Customisable finite adaptive MCMC algorithm for fast parameter inference.
  • Pooley model based proposal (MBP) method for improved mixing.
  • Simulation via the Gillespie direct method.
  • Automated tools for convergence diagnosis and analysis.

Installation

Discuit in R relies on [Discuit.jl][discuit_j_repo] for much of the heavy computation and as such Julia is required for some functions (the exception is visualisation and a few other light analysis tools).

  1. Follow the platform specific instructions for installing Julia on your computer.

  2. Verify that Julia has been installed and added to the environment variable correctly by opening a command prompt or console and using: julia.

  3. The R package is still in development but the development version can be installed using:

devtools::install_github("mjb3/Discuit")

Getting started

The following code initialises a DiscuitModel and runs a simulation, storing the results in x.

model = DiscuitModel("SIS", c(100, 1))
x = RunSimulation(model, c(0.003, 0.1))

Further usage

See the Discuit examples article for an overview of package functionality, with further information regarding the pre defined model library available in Models. See the Discuit.jl package documentation for information about the underlying Julia package.