Copyright | (c) Dominik Schrempf 2019 |
---|---|
License | GPL-3 |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Tue Jan 29 19:17:40 2019.
To be imported qualified.
Synopsis
- type Weight = Double
- data Component = Component Weight SubstitutionModel
- data MixtureModel = MixtureModel Name [Component]
- name :: Lens' MixtureModel Name
- getAlphabet :: MixtureModel -> Alphabet
- getWeights :: MixtureModel -> [Weight]
- getSubstitutionModels :: MixtureModel -> [SubstitutionModel]
- fromSubstitutionModels :: Name -> [Weight] -> [SubstitutionModel] -> MixtureModel
- concatenate :: Name -> [MixtureModel] -> MixtureModel
- scale :: Double -> MixtureModel -> MixtureModel
- normalize :: MixtureModel -> MixtureModel
- appendName :: Name -> MixtureModel -> MixtureModel
- isValid :: MixtureModel -> Bool
- summarizeComponent :: Component -> [ByteString]
- summarize :: MixtureModel -> [ByteString]
Types
A mixture model component has a weight and a substitution model.
data MixtureModel Source #
A mixture model with its components.
Instances
Read MixtureModel Source # | |
Defined in ELynx.Data.MarkovProcess.MixtureModel readsPrec :: Int -> ReadS MixtureModel # readList :: ReadS [MixtureModel] # | |
Show MixtureModel Source # | |
Defined in ELynx.Data.MarkovProcess.MixtureModel showsPrec :: Int -> MixtureModel -> ShowS # show :: MixtureModel -> String # showList :: [MixtureModel] -> ShowS # |
Lenses and other accessors
getAlphabet :: MixtureModel -> Alphabet Source #
Get alphabet used with mixture model. Throws error if components use different
Alphabet
s.
getWeights :: MixtureModel -> [Weight] Source #
Get weights.
getSubstitutionModels :: MixtureModel -> [SubstitutionModel] Source #
Get substitution models.
Building mixture models
fromSubstitutionModels :: Name -> [Weight] -> [SubstitutionModel] -> MixtureModel Source #
Create a mixture model from a list of substitution models.
Transformations
concatenate :: Name -> [MixtureModel] -> MixtureModel Source #
Concatenate mixture models.
scale :: Double -> MixtureModel -> MixtureModel Source #
Scale all substitution models of the mixture model.
normalize :: MixtureModel -> MixtureModel Source #
Globally normalize a mixture model so that on average one event happens per unit time.
appendName :: Name -> MixtureModel -> MixtureModel Source #
Append byte string to all substitution models of mixture model.
Tests
isValid :: MixtureModel -> Bool Source #
Checks if a mixture model is valid.
XXX: For the future, a proper way of creating mixture models might be of interest. For example, not exporting the constructor nor the record fields and providing an algebraic way of creating mixture models (empty and addComponent which performs necessary checks).
Output
summarizeComponent :: Component -> [ByteString] Source #
Summarize a mixture model component; lines to be printed to screen or log.
summarize :: MixtureModel -> [ByteString] Source #
Summarize a mixture model; lines to be printed to screen or log.