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

Safe HaskellNone
LanguageHaskell2010

Math.HiddenMarkovModel.Distribution

Documentation

type family Emission distr Source #

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

Defined in Math.HiddenMarkovModel.Distribution

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

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Discrete symbol sh prob) = symbol

type family Probability distr Source #

Instances
type Probability (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Probability (Gaussian emiSh stateSh a) = a
type Probability (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Probability (Discrete symbol sh prob) = prob

type family StateShape distr Source #

Instances
type StateShape (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type StateShape (Gaussian emiSh stateSh a) = stateSh
type StateShape (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type StateShape (Discrete symbol sh prob) = sh

class Real (Probability distr) => Info distr where Source #

Methods

statesShape :: distr -> StateShape distr Source #

Instances
(Indexed stateSh, Eq stateSh, Real a) => Info (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: Gaussian emiSh stateSh a -> StateShape (Gaussian emiSh stateSh a) Source #

(C sh, Real prob, Ord symbol) => Info (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: Discrete symbol sh prob -> StateShape (Discrete symbol sh prob) Source #

class Real (Probability distr) => Generate distr where Source #

Methods

generate :: (RandomGen g, Emission distr ~ emission, StateShape distr ~ sh) => distr -> Index sh -> State g emission Source #

Instances
(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => Generate (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (RandomGen g, Emission (Gaussian emiSh stateSh a) ~ emission, StateShape (Gaussian emiSh stateSh a) ~ sh) => Gaussian emiSh stateSh a -> Index sh -> State g emission Source #

(Indexed sh, Real prob, Ord symbol, Ord prob, Random prob) => Generate (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (RandomGen g, Emission (Discrete symbol sh prob) ~ emission, StateShape (Discrete symbol sh prob) ~ sh0) => Discrete symbol sh prob -> Index sh0 -> State g emission Source #

class (Indexed (StateShape distr), Real (Probability distr)) => EmissionProb distr where Source #

Minimal complete definition

emissionProb

Methods

emissionProb :: distr -> Emission distr -> Vector (StateShape distr) (Probability distr) Source #

emissionStateProb :: distr -> Emission distr -> Index (StateShape distr) -> Probability distr Source #

Instances
(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => EmissionProb (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

emissionProb :: Gaussian emiSh stateSh a -> Emission (Gaussian emiSh stateSh a) -> Vector (StateShape (Gaussian emiSh stateSh a)) (Probability (Gaussian emiSh stateSh a)) Source #

emissionStateProb :: Gaussian emiSh stateSh a -> Emission (Gaussian emiSh stateSh a) -> Index (StateShape (Gaussian emiSh stateSh a)) -> Probability (Gaussian emiSh stateSh a) Source #

(Indexed sh, Real prob, Ord symbol) => EmissionProb (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

emissionProb :: Discrete symbol sh prob -> Emission (Discrete symbol sh prob) -> Vector (StateShape (Discrete symbol sh prob)) (Probability (Discrete symbol sh prob)) Source #

emissionStateProb :: Discrete symbol sh prob -> Emission (Discrete symbol sh prob) -> Index (StateShape (Discrete symbol sh prob)) -> Probability (Discrete symbol sh prob) Source #

class (Distribution tdistr ~ distr, Trained distr ~ tdistr, EmissionProb distr) => Estimate tdistr distr where Source #

Associated Types

type Distribution tdistr Source #

type Trained distr Source #

Methods

accumulateEmissions :: (Probability distr ~ prob, StateShape distr ~ sh) => Array sh [(Emission distr, prob)] -> tdistr Source #

combine :: tdistr -> tdistr -> tdistr Source #

normalize :: tdistr -> distr Source #

Instances
(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => Estimate (GaussianTrained emiSh stateSh a) (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (GaussianTrained emiSh stateSh a) :: Type Source #

type Trained (Gaussian emiSh stateSh a) :: Type Source #

Methods

accumulateEmissions :: (Probability (Gaussian emiSh stateSh a) ~ prob, StateShape (Gaussian emiSh stateSh a) ~ sh) => Array sh [(Emission (Gaussian emiSh stateSh a), prob)] -> GaussianTrained emiSh stateSh a Source #

combine :: GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a Source #

normalize :: GaussianTrained emiSh stateSh a -> Gaussian emiSh stateSh a Source #

(Indexed sh, Eq sh, Real prob, Ord symbol) => Estimate (DiscreteTrained symbol sh prob) (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (DiscreteTrained symbol sh prob) :: Type Source #

type Trained (Discrete symbol sh prob) :: Type Source #

Methods

accumulateEmissions :: (Probability (Discrete symbol sh prob) ~ prob0, StateShape (Discrete symbol sh prob) ~ sh0) => Array sh0 [(Emission (Discrete symbol sh prob), prob0)] -> DiscreteTrained symbol sh prob Source #

combine :: DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob Source #

normalize :: DiscreteTrained symbol sh prob -> Discrete symbol sh prob Source #

newtype Discrete symbol sh prob Source #

Constructors

Discrete (Map symbol (Vector sh prob)) 
Instances
(C sh, Storable prob, Show symbol, Show sh, Show prob) => Show (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> Discrete symbol sh prob -> ShowS #

show :: Discrete symbol sh prob -> String #

showList :: [Discrete symbol sh prob] -> ShowS #

(NFData sh, NFData prob, NFData symbol) => NFData (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: Discrete symbol sh prob -> () #

(FormatArray sh, Real prob, Format symbol) => Format (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: String -> Discrete symbol sh prob -> Box #

(C sh, Real prob, Show prob, Read prob, CSVSymbol symbol) => FromCSV (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: StateShape (Discrete symbol sh prob) -> CSVParser (Discrete symbol sh prob) Source #

(C sh, Real prob, Show prob, Read prob, CSVSymbol symbol) => ToCSV (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: Discrete symbol sh prob -> [[String]] Source #

(Indexed sh, Real prob, Ord symbol) => EmissionProb (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

emissionProb :: Discrete symbol sh prob -> Emission (Discrete symbol sh prob) -> Vector (StateShape (Discrete symbol sh prob)) (Probability (Discrete symbol sh prob)) Source #

emissionStateProb :: Discrete symbol sh prob -> Emission (Discrete symbol sh prob) -> Index (StateShape (Discrete symbol sh prob)) -> Probability (Discrete symbol sh prob) Source #

(Indexed sh, Real prob, Ord symbol, Ord prob, Random prob) => Generate (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (RandomGen g, Emission (Discrete symbol sh prob) ~ emission, StateShape (Discrete symbol sh prob) ~ sh0) => Discrete symbol sh prob -> Index sh0 -> State g emission Source #

(C sh, Real prob, Ord symbol) => Info (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: Discrete symbol sh prob -> StateShape (Discrete symbol sh prob) Source #

(Indexed sh, Eq sh, Real prob, Ord symbol) => Estimate (DiscreteTrained symbol sh prob) (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (DiscreteTrained symbol sh prob) :: Type Source #

type Trained (Discrete symbol sh prob) :: Type Source #

Methods

accumulateEmissions :: (Probability (Discrete symbol sh prob) ~ prob0, StateShape (Discrete symbol sh prob) ~ sh0) => Array sh0 [(Emission (Discrete symbol sh prob), prob0)] -> DiscreteTrained symbol sh prob Source #

combine :: DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob Source #

normalize :: DiscreteTrained symbol sh prob -> Discrete symbol sh prob Source #

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

Defined in Math.HiddenMarkovModel.Distribution

type Trained (Discrete symbol sh prob) = DiscreteTrained symbol sh prob
type StateShape (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type StateShape (Discrete symbol sh prob) = sh
type Emission (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Discrete symbol sh prob) = symbol
type Probability (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Probability (Discrete symbol sh prob) = prob

newtype DiscreteTrained symbol sh prob Source #

Constructors

DiscreteTrained (Map symbol (Vector sh prob)) 
Instances
(C sh, Storable prob, Show symbol, Show sh, Show prob) => Show (DiscreteTrained symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> DiscreteTrained symbol sh prob -> ShowS #

show :: DiscreteTrained symbol sh prob -> String #

showList :: [DiscreteTrained symbol sh prob] -> ShowS #

(NFData sh, NFData prob, NFData symbol) => NFData (DiscreteTrained symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: DiscreteTrained symbol sh prob -> () #

(Indexed sh, Eq sh, Real prob, Ord symbol) => Estimate (DiscreteTrained symbol sh prob) (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (DiscreteTrained symbol sh prob) :: Type Source #

type Trained (Discrete symbol sh prob) :: Type Source #

Methods

accumulateEmissions :: (Probability (Discrete symbol sh prob) ~ prob0, StateShape (Discrete symbol sh prob) ~ sh0) => Array sh0 [(Emission (Discrete symbol sh prob), prob0)] -> DiscreteTrained symbol sh prob Source #

combine :: DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob -> DiscreteTrained symbol sh prob Source #

normalize :: DiscreteTrained symbol sh prob -> Discrete symbol sh prob Source #

type Distribution (DiscreteTrained symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Distribution (DiscreteTrained symbol sh prob) = Discrete symbol sh prob

newtype Gaussian emiSh stateSh a Source #

Constructors

Gaussian (Array stateSh (Vector emiSh a, UpperTriangular emiSh a, a)) 
Instances
(C stateSh, C emiSh, Storable a, Show stateSh, Show emiSh, Show a) => Show (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> Gaussian emiSh stateSh a -> ShowS #

show :: Gaussian emiSh stateSh a -> String #

showList :: [Gaussian emiSh stateSh a] -> ShowS #

(NFData emiSh, NFData stateSh, C stateSh, NFData a, Storable a) => NFData (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: Gaussian emiSh stateSh a -> () #

(FormatArray emiSh, C stateSh, Real a) => Format (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

format :: String -> Gaussian emiSh stateSh a -> Box #

(emiSh ~ ZeroInt, Indexed stateSh, Real a, Eq a, Show a, Read a) => FromCSV (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: StateShape (Gaussian emiSh stateSh a) -> CSVParser (Gaussian emiSh stateSh a) Source #

(Indexed emiSh, Indexed stateSh, Real a, Eq a, Show a, Read a) => ToCSV (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: Gaussian emiSh stateSh a -> [[String]] Source #

(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => EmissionProb (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

emissionProb :: Gaussian emiSh stateSh a -> Emission (Gaussian emiSh stateSh a) -> Vector (StateShape (Gaussian emiSh stateSh a)) (Probability (Gaussian emiSh stateSh a)) Source #

emissionStateProb :: Gaussian emiSh stateSh a -> Emission (Gaussian emiSh stateSh a) -> Index (StateShape (Gaussian emiSh stateSh a)) -> Probability (Gaussian emiSh stateSh a) Source #

(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => Generate (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

generate :: (RandomGen g, Emission (Gaussian emiSh stateSh a) ~ emission, StateShape (Gaussian emiSh stateSh a) ~ sh) => Gaussian emiSh stateSh a -> Index sh -> State g emission Source #

(Indexed stateSh, Eq stateSh, Real a) => Info (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

statesShape :: Gaussian emiSh stateSh a -> StateShape (Gaussian emiSh stateSh a) Source #

(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => Estimate (GaussianTrained emiSh stateSh a) (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (GaussianTrained emiSh stateSh a) :: Type Source #

type Trained (Gaussian emiSh stateSh a) :: Type Source #

Methods

accumulateEmissions :: (Probability (Gaussian emiSh stateSh a) ~ prob, StateShape (Gaussian emiSh stateSh a) ~ sh) => Array sh [(Emission (Gaussian emiSh stateSh a), prob)] -> GaussianTrained emiSh stateSh a Source #

combine :: GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a Source #

normalize :: GaussianTrained emiSh stateSh a -> Gaussian emiSh stateSh a Source #

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

Defined in Math.HiddenMarkovModel.Distribution

type Trained (Gaussian emiSh stateSh a) = GaussianTrained emiSh stateSh a
type StateShape (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type StateShape (Gaussian emiSh stateSh a) = stateSh
type Emission (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Emission (Gaussian emiSh stateSh a) = Vector emiSh a
type Probability (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Probability (Gaussian emiSh stateSh a) = a

newtype GaussianTrained emiSh stateSh a Source #

Constructors

GaussianTrained (Array stateSh (Maybe (Vector emiSh a, HermitianMatrix emiSh a, a))) 
Instances
(C stateSh, C emiSh, Storable a, Show stateSh, Show emiSh, Show a) => Show (GaussianTrained emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

showsPrec :: Int -> GaussianTrained emiSh stateSh a -> ShowS #

show :: GaussianTrained emiSh stateSh a -> String #

showList :: [GaussianTrained emiSh stateSh a] -> ShowS #

(NFData emiSh, NFData stateSh, C stateSh, NFData a, Storable a) => NFData (GaussianTrained emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

rnf :: GaussianTrained emiSh stateSh a -> () #

(C emiSh, Eq emiSh, Indexed stateSh, Eq stateSh, Real a) => Estimate (GaussianTrained emiSh stateSh a) (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Associated Types

type Distribution (GaussianTrained emiSh stateSh a) :: Type Source #

type Trained (Gaussian emiSh stateSh a) :: Type Source #

Methods

accumulateEmissions :: (Probability (Gaussian emiSh stateSh a) ~ prob, StateShape (Gaussian emiSh stateSh a) ~ sh) => Array sh [(Emission (Gaussian emiSh stateSh a), prob)] -> GaussianTrained emiSh stateSh a Source #

combine :: GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a -> GaussianTrained emiSh stateSh a Source #

normalize :: GaussianTrained emiSh stateSh a -> Gaussian emiSh stateSh a Source #

type Distribution (GaussianTrained emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

type Distribution (GaussianTrained emiSh stateSh a) = Gaussian emiSh stateSh a

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

class ToCSV distr where Source #

Methods

toCells :: distr -> [[String]] Source #

Instances
(Indexed emiSh, Indexed stateSh, Real a, Eq a, Show a, Read a) => ToCSV (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: Gaussian emiSh stateSh a -> [[String]] Source #

(C sh, Real prob, Show prob, Read prob, CSVSymbol symbol) => ToCSV (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

toCells :: Discrete symbol sh prob -> [[String]] Source #

class FromCSV distr where Source #

Methods

parseCells :: StateShape distr -> CSVParser distr Source #

Instances
(emiSh ~ ZeroInt, Indexed stateSh, Real a, Eq a, Show a, Read a) => FromCSV (Gaussian emiSh stateSh a) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: StateShape (Gaussian emiSh stateSh a) -> CSVParser (Gaussian emiSh stateSh a) Source #

(C sh, Real prob, Show prob, Read prob, CSVSymbol symbol) => FromCSV (Discrete symbol sh prob) Source # 
Instance details

Defined in Math.HiddenMarkovModel.Distribution

Methods

parseCells :: StateShape (Discrete symbol sh prob) -> CSVParser (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