rmcmc 0.1.0

RMCMC is a Bayesian statistics toolkit with implements, among other algorithms, Markov-Chain-Monte-Carlo.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate rand;
use rand::Rng;

/// A stepping algorithm which draws the next stage from the Markov Chain.
pub trait SteppingAlg<M> {
    // Advance the parameters by one step.
    fn step<R: Rng>(&self, rng: &mut R, model: &mut M) -> Self;
    // Enables adaption.
    fn adapt_on(&self) -> Self;
    // Disables adaption.
    fn adapt_off(&self) -> Self;
}

/// A stepping algorithm which supports annealing
pub trait AnnealingAlg<M>: SteppingAlg<M> {
    // Sets the temperature for the next step operation.
    fn set_temperature(&self, t: f64) -> Self;
}