hmm-lapack-0.4: Hidden Markov Models using LAPACK primitives

Safe HaskellNone
LanguageHaskell2010

Math.HiddenMarkovModel.Distribution

Synopsis

Documentation

data family T typ sh prob Source #

Instances
(Show typ, C sh, Show sh, Show prob, Storable prob) => Show (T typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> T typ sh prob -> ShowS #

show :: T typ sh prob -> String #

showList :: [T typ sh prob] -> ShowS #

(NFData typ, NFData sh, NFData prob, C sh) => NFData (T typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: T typ sh prob -> () #

(Format typ, C sh, Real prob) => Format (T typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: Output out => String -> T typ sh prob -> out #

newtype T (Gaussian emiSh) stateSh a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype T (Gaussian emiSh) stateSh a = Gaussian (Array stateSh (a, Vector emiSh a, Upper emiSh a))
newtype T (Discrete symbol) sh prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype T (Discrete symbol) sh prob = Discrete (General (Set symbol) sh prob)

data family Trained typ sh prob Source #

Instances
(Show typ, C sh, Show sh, Show prob, Storable prob) => Show (Trained typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> Trained typ sh prob -> ShowS #

show :: Trained typ sh prob -> String #

showList :: [Trained typ sh prob] -> ShowS #

(Estimate typ, C sh, Eq sh, Real prob) => Semigroup (Trained typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

(<>) :: Trained typ sh prob -> Trained typ sh prob -> Trained typ sh prob #

sconcat :: NonEmpty (Trained typ sh prob) -> Trained typ sh prob #

stimes :: Integral b => b -> Trained typ sh prob -> Trained typ sh prob #

(NFData typ, NFData sh, NFData prob, C sh) => NFData (Trained typ sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: Trained typ sh prob -> () #

newtype Trained (Gaussian emiSh) stateSh a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype Trained (Gaussian emiSh) stateSh a = GaussianTrained (Array (stateSh, Hermitian (() :+: emiSh)) a)
newtype Trained (Discrete symbol) sh prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype Trained (Discrete symbol) sh prob = DiscreteTrained (T symbol (Vector sh prob))

type family Emission typ prob Source #

Instances
type Emission (Gaussian emiSh) a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Gaussian emiSh) a = Vector emiSh a
type Emission (Discrete symbol) prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Discrete symbol) prob = symbol

class Show typ where Source #

Methods

showsPrec :: (C sh, Show sh, Show prob, Storable prob) => Int -> T typ sh prob -> ShowS Source #

showsPrecTrained :: (C sh, Show sh, Show prob, Storable prob) => Int -> Trained typ sh prob -> ShowS Source #

Instances
(C emiSh, Show emiSh) => Show (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: (C sh, Show sh, Show prob, Storable prob) => Int -> T (Gaussian emiSh) sh prob -> ShowS Source #

showsPrecTrained :: (C sh, Show sh, Show prob, Storable prob) => Int -> Trained (Gaussian emiSh) sh prob -> ShowS Source #

(Show symbol, Ord symbol) => Show (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: (C sh, Show sh, Show prob, Storable prob) => Int -> T (Discrete symbol) sh prob -> ShowS Source #

showsPrecTrained :: (C sh, Show sh, Show prob, Storable prob) => Int -> Trained (Discrete symbol) sh prob -> ShowS Source #

class NFData typ where Source #

Methods

rnf :: (NFData sh, NFData prob, C sh) => T typ sh prob -> () Source #

rnfTrained :: (NFData sh, NFData prob, C sh) => Trained typ sh prob -> () Source #

Instances
NFData emiSh => NFData (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: (NFData sh, NFData prob, C sh) => T (Gaussian emiSh) sh prob -> () Source #

rnfTrained :: (NFData sh, NFData prob, C sh) => Trained (Gaussian emiSh) sh prob -> () Source #

NFData symbol => NFData (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: (NFData sh, NFData prob, C sh) => T (Discrete symbol) sh prob -> () Source #

rnfTrained :: (NFData sh, NFData prob, C sh) => Trained (Discrete symbol) sh prob -> () Source #

class Format typ where Source #

Methods

format :: (C sh, Output out, Real prob) => String -> T typ sh prob -> out Source #

Instances
FormatArray emiSh => Format (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: (C sh, Output out, Real prob) => String -> T (Gaussian emiSh) sh prob -> out Source #

(Show symbol, Ord symbol) => Format (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: (C sh, Output out, Real prob) => String -> T (Discrete symbol) sh prob -> out Source #

class Info typ where Source #

Methods

statesShape :: C sh => T typ sh prob -> sh Source #

statesShapeTrained :: C sh => Trained typ sh prob -> sh Source #

Instances
Info (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: C sh => T (Gaussian emiSh) sh prob -> sh Source #

statesShapeTrained :: C sh => Trained (Gaussian emiSh) sh prob -> sh Source #

Ord symbol => Info (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: C sh => T (Discrete symbol) sh prob -> sh Source #

statesShapeTrained :: C sh => Trained (Discrete symbol) sh prob -> sh Source #

class Generate typ where Source #

Methods

generate :: (Indexed sh, Real prob, Random prob, RandomGen g) => T typ sh prob -> Index sh -> State g (Emission typ prob) Source #

Instances
(C emiSh, Eq emiSh) => Generate (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (Indexed sh, Real prob, Random prob, RandomGen g) => T (Gaussian emiSh) sh prob -> Index sh -> State g (Emission (Gaussian emiSh) prob) Source #

Ord symbol => Generate (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (Indexed sh, Real prob, Random prob, RandomGen g) => T (Discrete symbol) sh prob -> Index sh -> State g (Emission (Discrete symbol) prob) Source #

class EmissionProb typ where Source #

Minimal complete definition

mapStatesShape, emissionProb

Methods

mapStatesShape :: (C sh0, C sh1) => (sh0 -> sh1) -> T typ sh0 prob -> T typ sh1 prob Source #

emissionProb :: (C sh, Real prob) => T typ sh prob -> Emission typ prob -> Vector sh prob Source #

emissionStateProb :: (Indexed sh, Real prob) => T typ sh prob -> Emission typ prob -> Index sh -> prob Source #

Instances
(C emiSh, Eq emiSh) => EmissionProb (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

mapStatesShape :: (C sh0, C sh1) => (sh0 -> sh1) -> T (Gaussian emiSh) sh0 prob -> T (Gaussian emiSh) sh1 prob Source #

emissionProb :: (C sh, Real prob) => T (Gaussian emiSh) sh prob -> Emission (Gaussian emiSh) prob -> Vector sh prob Source #

emissionStateProb :: (Indexed sh, Real prob) => T (Gaussian emiSh) sh prob -> Emission (Gaussian emiSh) prob -> Index sh -> prob Source #

Ord symbol => EmissionProb (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

mapStatesShape :: (C sh0, C sh1) => (sh0 -> sh1) -> T (Discrete symbol) sh0 prob -> T (Discrete symbol) sh1 prob Source #

emissionProb :: (C sh, Real prob) => T (Discrete symbol) sh prob -> Emission (Discrete symbol) prob -> Vector sh prob Source #

emissionStateProb :: (Indexed sh, Real prob) => T (Discrete symbol) sh prob -> Emission (Discrete symbol) prob -> Index sh -> prob Source #

class EmissionProb typ => Estimate typ where Source #

Methods

accumulateEmissions :: (Indexed sh, Real prob, Index sh ~ state) => sh -> T [] (state, Emission typ prob) -> Trained typ sh prob Source #

trainVector :: (C sh, Eq sh, Real prob) => Emission typ prob -> Vector sh prob -> Trained typ sh prob Source #

combine :: (C sh, Eq sh, Real prob) => Trained typ sh prob -> Trained typ sh prob -> Trained typ sh prob Source #

normalize :: (C sh, Eq sh, Real prob) => Trained typ sh prob -> T typ sh prob Source #

Instances
(C emiSh, Eq emiSh) => Estimate (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

accumulateEmissions :: (Indexed sh, Real prob, Index sh ~ state) => sh -> T [] (state, Emission (Gaussian emiSh) prob) -> Trained (Gaussian emiSh) sh prob Source #

trainVector :: (C sh, Eq sh, Real prob) => Emission (Gaussian emiSh) prob -> Vector sh prob -> Trained (Gaussian emiSh) sh prob Source #

combine :: (C sh, Eq sh, Real prob) => Trained (Gaussian emiSh) sh prob -> Trained (Gaussian emiSh) sh prob -> Trained (Gaussian emiSh) sh prob Source #

normalize :: (C sh, Eq sh, Real prob) => Trained (Gaussian emiSh) sh prob -> T (Gaussian emiSh) sh prob Source #

Ord symbol => Estimate (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

accumulateEmissions :: (Indexed sh, Real prob, Index sh ~ state) => sh -> T [] (state, Emission (Discrete symbol) prob) -> Trained (Discrete symbol) sh prob Source #

trainVector :: (C sh, Eq sh, Real prob) => Emission (Discrete symbol) prob -> Vector sh prob -> Trained (Discrete symbol) sh prob Source #

combine :: (C sh, Eq sh, Real prob) => Trained (Discrete symbol) sh prob -> Trained (Discrete symbol) sh prob -> Trained (Discrete symbol) sh prob Source #

normalize :: (C sh, Eq sh, Real prob) => Trained (Discrete symbol) sh prob -> T (Discrete symbol) sh prob Source #

accumulateEmissionVectors :: (Estimate typ, C sh, Eq sh, Real prob) => T [] (Emission typ prob, Vector sh prob) -> Trained typ sh prob Source #

data Discrete symbol Source #

Instances
CSVSymbol symbol => FromCSV (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: (C sh, Eq sh, Real prob, Read prob) => sh -> CSVParser (T (Discrete symbol) sh prob) Source #

CSVSymbol symbol => ToCSV (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: (C sh, Real prob, Show prob) => T (Discrete symbol) sh prob -> [[String]] Source #

Ord symbol => Estimate (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

accumulateEmissions :: (Indexed sh, Real prob, Index sh ~ state) => sh -> T [] (state, Emission (Discrete symbol) prob) -> Trained (Discrete symbol) sh prob Source #

trainVector :: (C sh, Eq sh, Real prob) => Emission (Discrete symbol) prob -> Vector sh prob -> Trained (Discrete symbol) sh prob Source #

combine :: (C sh, Eq sh, Real prob) => Trained (Discrete symbol) sh prob -> Trained (Discrete symbol) sh prob -> Trained (Discrete symbol) sh prob Source #

normalize :: (C sh, Eq sh, Real prob) => Trained (Discrete symbol) sh prob -> T (Discrete symbol) sh prob Source #

Ord symbol => EmissionProb (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

mapStatesShape :: (C sh0, C sh1) => (sh0 -> sh1) -> T (Discrete symbol) sh0 prob -> T (Discrete symbol) sh1 prob Source #

emissionProb :: (C sh, Real prob) => T (Discrete symbol) sh prob -> Emission (Discrete symbol) prob -> Vector sh prob Source #

emissionStateProb :: (Indexed sh, Real prob) => T (Discrete symbol) sh prob -> Emission (Discrete symbol) prob -> Index sh -> prob Source #

Ord symbol => Generate (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (Indexed sh, Real prob, Random prob, RandomGen g) => T (Discrete symbol) sh prob -> Index sh -> State g (Emission (Discrete symbol) prob) Source #

Ord symbol => Info (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: C sh => T (Discrete symbol) sh prob -> sh Source #

statesShapeTrained :: C sh => Trained (Discrete symbol) sh prob -> sh Source #

(Show symbol, Ord symbol) => Format (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: (C sh, Output out, Real prob) => String -> T (Discrete symbol) sh prob -> out Source #

NFData symbol => NFData (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: (NFData sh, NFData prob, C sh) => T (Discrete symbol) sh prob -> () Source #

rnfTrained :: (NFData sh, NFData prob, C sh) => Trained (Discrete symbol) sh prob -> () Source #

(Show symbol, Ord symbol) => Show (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: (C sh, Show sh, Show prob, Storable prob) => Int -> T (Discrete symbol) sh prob -> ShowS Source #

showsPrecTrained :: (C sh, Show sh, Show prob, Storable prob) => Int -> Trained (Discrete symbol) sh prob -> ShowS Source #

newtype Trained (Discrete symbol) sh prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype Trained (Discrete symbol) sh prob = DiscreteTrained (T symbol (Vector sh prob))
newtype T (Discrete symbol) sh prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype T (Discrete symbol) sh prob = Discrete (General (Set symbol) sh prob)
type Emission (Discrete symbol) prob Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Discrete symbol) prob = symbol

discreteFromList :: (Ord symbol, C sh, Eq sh, Real prob) => T [] (symbol, Vector sh prob) -> T (Discrete symbol) sh prob Source #

data Gaussian emiSh Source #

Instances
emiSh ~ ShapeInt => FromCSV (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: (C sh, Eq sh, Real prob, Read prob) => sh -> CSVParser (T (Gaussian emiSh) sh prob) Source #

Indexed emiSh => ToCSV (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: (C sh, Real prob, Show prob) => T (Gaussian emiSh) sh prob -> [[String]] Source #

(C emiSh, Eq emiSh) => Estimate (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

accumulateEmissions :: (Indexed sh, Real prob, Index sh ~ state) => sh -> T [] (state, Emission (Gaussian emiSh) prob) -> Trained (Gaussian emiSh) sh prob Source #

trainVector :: (C sh, Eq sh, Real prob) => Emission (Gaussian emiSh) prob -> Vector sh prob -> Trained (Gaussian emiSh) sh prob Source #

combine :: (C sh, Eq sh, Real prob) => Trained (Gaussian emiSh) sh prob -> Trained (Gaussian emiSh) sh prob -> Trained (Gaussian emiSh) sh prob Source #

normalize :: (C sh, Eq sh, Real prob) => Trained (Gaussian emiSh) sh prob -> T (Gaussian emiSh) sh prob Source #

(C emiSh, Eq emiSh) => EmissionProb (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

mapStatesShape :: (C sh0, C sh1) => (sh0 -> sh1) -> T (Gaussian emiSh) sh0 prob -> T (Gaussian emiSh) sh1 prob Source #

emissionProb :: (C sh, Real prob) => T (Gaussian emiSh) sh prob -> Emission (Gaussian emiSh) prob -> Vector sh prob Source #

emissionStateProb :: (Indexed sh, Real prob) => T (Gaussian emiSh) sh prob -> Emission (Gaussian emiSh) prob -> Index sh -> prob Source #

(C emiSh, Eq emiSh) => Generate (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (Indexed sh, Real prob, Random prob, RandomGen g) => T (Gaussian emiSh) sh prob -> Index sh -> State g (Emission (Gaussian emiSh) prob) Source #

Info (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: C sh => T (Gaussian emiSh) sh prob -> sh Source #

statesShapeTrained :: C sh => Trained (Gaussian emiSh) sh prob -> sh Source #

FormatArray emiSh => Format (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: (C sh, Output out, Real prob) => String -> T (Gaussian emiSh) sh prob -> out Source #

NFData emiSh => NFData (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: (NFData sh, NFData prob, C sh) => T (Gaussian emiSh) sh prob -> () Source #

rnfTrained :: (NFData sh, NFData prob, C sh) => Trained (Gaussian emiSh) sh prob -> () Source #

(C emiSh, Show emiSh) => Show (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: (C sh, Show sh, Show prob, Storable prob) => Int -> T (Gaussian emiSh) sh prob -> ShowS Source #

showsPrecTrained :: (C sh, Show sh, Show prob, Storable prob) => Int -> Trained (Gaussian emiSh) sh prob -> ShowS Source #

newtype Trained (Gaussian emiSh) stateSh a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype Trained (Gaussian emiSh) stateSh a = GaussianTrained (Array (stateSh, Hermitian (() :+: emiSh)) a)
newtype T (Gaussian emiSh) stateSh a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

newtype T (Gaussian emiSh) stateSh a = Gaussian (Array stateSh (a, Vector emiSh a, Upper emiSh a))
type Emission (Gaussian emiSh) a Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Gaussian emiSh) a = Vector emiSh a

gaussian :: (C emiSh, C stateSh, Real prob) => Array stateSh (Vector emiSh prob, Hermitian emiSh prob) -> T (Gaussian emiSh) stateSh prob Source #

gaussianTrained :: (C emiSh, Eq emiSh, C stateSh, Real prob) => Array stateSh (prob, Vector emiSh prob, Hermitian emiSh prob) -> Trained (Gaussian emiSh) stateSh prob Source #

input array must be non-empty

class ToCSV typ where Source #

Methods

toCells :: (C sh, Real prob, Show prob) => T typ sh prob -> [[String]] Source #

Instances
Indexed emiSh => ToCSV (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: (C sh, Real prob, Show prob) => T (Gaussian emiSh) sh prob -> [[String]] Source #

CSVSymbol symbol => ToCSV (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: (C sh, Real prob, Show prob) => T (Discrete symbol) sh prob -> [[String]] Source #

class FromCSV typ where Source #

Methods

parseCells :: (C sh, Eq sh, Real prob, Read prob) => sh -> CSVParser (T typ sh prob) Source #

Instances
emiSh ~ ShapeInt => FromCSV (Gaussian emiSh) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: (C sh, Eq sh, Real prob, Read prob) => sh -> CSVParser (T (Gaussian emiSh) sh prob) Source #

CSVSymbol symbol => FromCSV (Discrete symbol) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: (C sh, Eq sh, Real prob, Read prob) => sh -> CSVParser (T (Discrete symbol) sh prob) Source #

class Ord symbol => CSVSymbol symbol where Source #

Methods

cellFromSymbol :: symbol -> String Source #

symbolFromCell :: String -> Maybe symbol Source #

Instances
CSVSymbol Char Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

CSVSymbol Int Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

CSVSymbol Color Source #

Using show and read is not always a good choice since they must format and parse Haskell expressions which is not of much use to the outside world.

Instance details

Defined in Math.HiddenMarkovModel.Example.TrafficLightPrivate