hmm-hmatrix-0.0.2: Hidden Markov Models using HMatrix primitives

Safe HaskellNone
LanguageHaskell2010

Math.HiddenMarkovModel.Pattern

Description

This module provides a simple way to train the transition matrix and initial probability vector using simple patterns of state sequences.

You may create a trained model using semigroup combinators like this:

let a = atom $ HMM.state 0
    b = atom $ HMM.state 1
    distr =
       Distr.DiscreteTrained $ Map.fromList $
       ('a', Vector.fromList [1,2]) :
       ('b', Vector.fromList [4,3]) :
       ('c', Vector.fromList [0,1]) :
       []
in  finish 2 distr $ replicate 5 $ replicate 10 a <> replicate 20 b

Documentation

data T prob Source

Instances

Field prob => Semigroup (T prob) Source 

atom :: Container Vector prob => State -> T prob Source

append :: Container Vector prob => T prob -> T prob -> T prob infixl 5 Source

replicate :: Container Vector prob => Int -> T prob -> T prob Source

finish :: Container Vector prob => Int -> tdistr -> T prob -> Trained tdistr prob Source