epi-sim-0.2.2.0: A library for simulating epidemics as birth-death processes.

Safe HaskellNone
LanguageHaskell2010

Epidemic.Utility

Synopsis

Documentation

selectElem :: Vector a -> Int -> (a, Vector a) Source #

data NBranch Source #

Constructors

NBranch NSubtree NLength 
Instances
Eq NBranch Source # 
Instance details

Defined in Epidemic.Utility

Methods

(==) :: NBranch -> NBranch -> Bool #

(/=) :: NBranch -> NBranch -> Bool #

Show NBranch Source # 
Instance details

Defined in Epidemic.Utility

data NBranchSet Source #

Constructors

NBranchSet [NBranch] 
Instances
Eq NBranchSet Source # 
Instance details

Defined in Epidemic.Utility

Show NBranchSet Source # 
Instance details

Defined in Epidemic.Utility

data NSubtree Source #

Instances
Eq NSubtree Source # 
Instance details

Defined in Epidemic.Utility

Show NSubtree Source # 
Instance details

Defined in Epidemic.Utility

data NTree Source #

Constructors

NTree [NBranch] 
Instances
Eq NTree Source # 
Instance details

Defined in Epidemic.Utility

Methods

(==) :: NTree -> NTree -> Bool #

(/=) :: NTree -> NTree -> Bool #

Show NTree Source # 
Instance details

Defined in Epidemic.Utility

Methods

showsPrec :: Int -> NTree -> ShowS #

show :: NTree -> String #

showList :: [NTree] -> ShowS #

sort :: Ord a => [a] -> [a] Source #

Example run > (Success foo) = parseString newickTree mempty "((foo:1.1,bar:1.2):1.3,baz:1.4);" > (Success bar) = parseString newickTree mempty $ show foo > foo == bar True

count' :: (a -> Bool) -> [a] -> Int Source #

simulation Source #

Arguments

:: ModelParameters a 
=> Bool

Condition upon at least two leaves in the reconstructed tree

-> SimulationConfiguration a b 
-> (a -> Time -> (Time, [EpidemicEvent], b, Integer) -> GenIO -> IO (Time, [EpidemicEvent], b, Integer)) 
-> IO [EpidemicEvent] 

Run a simulation described by a configuration object.

isNonReconTreeObservation :: EpidemicEvent -> Bool Source #

Predicate for whether an epidemic event is either an occurrence or a disaaster.

isReconTreeLeaf :: EpidemicEvent -> Bool Source #

Predicate for whether an epidemic event will appear as a leaf in the reconstructed tree.

simulationWithSystemRandom Source #

Arguments

:: ModelParameters a 
=> Bool

Condition upon at least two leaves in the reconstructed tree

-> SimulationConfiguration a b 
-> (a -> Time -> (Time, [EpidemicEvent], b, Integer) -> GenIO -> IO (Time, [EpidemicEvent], b, Integer)) 
-> IO [EpidemicEvent] 

Run a simulation described by a configuration object but using a random seed generated by the system rather than a seed

finalSize Source #

Arguments

:: [EpidemicEvent]

The events from the simulation

-> Integer 

The number of lineages at the end of a simulation.

inhomExponential Source #

Arguments

:: PrimMonad m 
=> Timed Double

Step function

-> Gen (PrimState m)

Generator.

-> m Double 

Generate exponentially distributed random variates with inhomogeneous rate.

randInhomExp Source #

Arguments

:: PrimMonad m 
=> Double

Timer

-> Timed Double

Step function

-> Gen (PrimState m)

Generator.

-> m (Maybe Double) 

Generate exponentially distributed random variates with inhomogeneous rate.