hmm-lapack-0.4.1: Hidden Markov Models using LAPACK primitives
Safe HaskellNone
LanguageHaskell2010

Math.HiddenMarkovModel.Example.CirclePrivate

Synopsis

Documentation

>>> import qualified Math.HiddenMarkovModel as HMM
>>> import qualified Data.NonEmpty as NonEmpty
>>> import Data.Eq.HT (equating)
>>> 
>>> checkTraining :: (Int, HMM) -> Bool
>>> checkTraining (maxDiff,hmm_) =
>>> maxDiff >=
>>> (length $ filter id $ NonEmpty.flatten $
>>> NonEmpty.zipWith (/=)
>>> (HMM.reveal hmm_ circle) (fmap fst circleLabeled))

data State Source #

Constructors

Q1 
Q2 
Q3 
Q4 

hmm :: HMM Source #

checkTraining (0, hmm)

revealed :: T [] State Source #

>>> take 20 $ NonEmpty.flatten revealed
[Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q3,Q3,Q3,Q4,Q4,Q4,Q1,Q1,Q1,Q2,Q2,Q2,Q3]
equating (take 1000 . NonEmpty.flatten) revealed $ fmap fst circleLabeled

reconstructDistribution :: Gaussian CoordinateSet () Double Source #

Sample multivariate normal distribution and reconstruct it from the samples. You should obtain the same parameters.

reconstructModel :: HMM Source #

Generate labeled emission sequences and use them for supervised training.

checkTraining (0, reconstructModel)

hmmTrainedSupervised :: HMM Source #

checkTraining (0, hmmTrainedSupervised)

hmmTrainedUnsupervised :: HMM Source #

checkTraining (0, hmmTrainedUnsupervised)

hmmIterativelyTrained :: HMM Source #

checkTraining (40, hmmIterativelyTrained)