simulate_pop: Simulate Many Generations

Description Usage Arguments Value Functions

Description

This steps a population forwards by many generations, according to the parameters in a demography object, returning the result at specified times in an array.

Usage

1
2
3
4
5
simulate_pop(population, demography, times, N = population$N, tinit = 0,
  summary.times = 1:max(times), summaries = NULL, stop.fun = NULL,
  return.everything = FALSE, ...)

simulation(N, summaries, times, summary.times, t, ...)

Arguments

population

A population object, the initial state (t=0) of the population.

demography

A demography object, containing the below parameters.

times

A sorted integer vector of times to record the full state of the population at.

N

Overrides the matrix of genotype counts in population, if present.

tinit

The current time at the beginning of the simulation (defaults to t=0).

summary.times

A sorted integer vector of times to record summaries of the population at.

summaries

A list of functions to apply to the matrix of genotype counts, population$N, at generations summary.times.

stop.fun

A function applied to N that, if it returns TRUE, will stop the simulation. (remainder of output array will be entirely zeros)

return.everything

Whether to record 'everything' as returned by generation().

...

Additional parameters that will be passed to generation().

Value

A named list, with elements N = an array with dimensions as population$N x length(times). summaries = A list of matrices, with dimensions (length of summary.times) x (length of output of summary function). times = As in the input. summary.times = As in the input. t = The final generation. and furthermore, if return.everything is TRUE, then gens = a list whose elements are as output by generation(...,return.everything=TRUE).

Functions


petrelharp/landsim documentation built on May 25, 2019, 2:53 a.m.