simulateEpidemic(Ninit = Inf, nu = 0, mu = 1/850, pe, sde, pg.init,
  GEValues, rateContact, rateInfect, rateDie, rateSample, rateMutate,
  rateTransTemplate = generateRateTransTemplate(numsAllelesAtSites),
  numsAllelesAtSites = NULL, eUniqForEachG = FALSE,
  selectWithinHost = FALSE, timeStep = 0.1, maxTime = 1200,
  maxNTips = 8000, expandTimeAfterMaxNTips = 1.5, reportInterval = 12,
  ...)

Arguments

Ninit

integer, initial population size

nu

numeric, birth rate (constant unit time influx in the population)

mu

numeric, natural death rate

pe

numeric vector of frequences for each environment type

sde

numeric, the standard deviation of the special environmental effects

pg.init

numeric initial frequencies from which the pathogen genotype of the first case is drawn

GEValues

numeric matrix with average value for individuals of specific immune system type infected by a specific pathogen. GEValues[i, j] is for individaul of immune type i and pathogen genotype j.

rateContact

numeric, the rate at which an infected individual has contact with a susceptible.

rateInfect

a function of two arguments, a numeric vector of trait values and a numeric rateContact parameter, returning a numeric vector of transmission rates corresponding z.

rateDie

a function of one argument, a numeric vector of trait values, returning a numeric vector of death rates corresponding to these values.

rateSample

numeric, the rate at which infected individuals get diagnozed and recover

rateMutate

a function of four arguments: the GEValues matrix (see above), a numeric vector es of special environmental effects, an integer vector envs of environment type indices and an integer vector genes of pathogen genotype indices, returning a numeric vector of the same size as the es with per-locus mutation rates.

rateTransTemplate

a square matrix of size n x (n-1) containing the factor by which the per locus mutation rate must be multiplied in order to obtain a transition rate between any two pathogen genotypes. See the function generateRateTransTemplate. rateTransTemplate[i,j] should be the factor for transition rate from state i to state j. By definition of transition rate matrices the transition from a state to itself is always the negative sum of the transition rates to the other states. This parameter needs not to be specified explicitly if the parameter numsAllelesAtSites is specified (see below).

numsAllelesAtSites

integer vector specifying the number of alleles at each site, the length of the vector defining the number of QTLs.

eUniqForEachG

logical indicating should the special environmental effect in an individual be drawn for each possible pathogen genotype or should there be a single special environmental effect for all genotypes.

selectWithinHost

logical indicating if there is selection for higher trait values within a host. When TRUE a mutation results in a transition from one genotype to another only if it results in a higher trait value for a host.

timeStep

numeric, the time resolution at which infection, mutation, sampling and death events are sampled.

maxTime

numeric, the maximum duration of a simulation before starting the graceful fade-away phase.

maxNTips

numeric, the maximum number of sampled individuals before starting the graceful fade-away phase.

expandTimeAfterMaxNTips

numeric greater or equal than 1 specifying how lone should the growth of the epidemic continue after reaching maxNTips or running the epidemic for maxTime/expandTimeAfterMaxNTips.

reportInterval

positive integer, time interval at which some statistics such as total infected and recovered counts and frequencies of genotypes in the population are stored.

Value

A list of objects