Copyright | (c) Dominik Schrempf 2019 |
---|---|

License | GPL-3 |

Maintainer | dominik.schrempf@gmail.com |

Stability | unstable |

Portability | portable |

Safe Haskell | None |

Language | Haskell2010 |

Creation date: Thu Jan 24 09:02:25 2019.

## Synopsis

- type ProbMatrix = Matrix R
- type State = Int
- probMatrix :: RateMatrix -> Double -> ProbMatrix
- jump :: PrimMonad m => State -> ProbMatrix -> Gen (PrimState m) -> m State

# Documentation

type ProbMatrix = Matrix R Source #

A probability matrix, P_ij(t) = Pr (X_t = j | X_0 = i).

probMatrix :: RateMatrix -> Double -> ProbMatrix Source #

The important matrix that gives the probabilities to move from one state to another in a specific time (branch length).

jump :: PrimMonad m => State -> ProbMatrix -> Gen (PrimState m) -> m State Source #

Move from a given state to a new one according to a transition probability matrix (for performance reasons this probability matrix needs to be given as a list of generators, see https://hackage.haskell.org/package/distribution-1.1.0.0/docs/Data-Distribution-Sample.html). This function is the bottleneck of the simulator and takes up most of the computation time. However, I was not able to find a faster implementation than the one from Data.Distribution.