fixation: Time to fixation for an spatial individual-based model

Description Usage Arguments Value

View source: R/fixation.R

Description

A simple example of using the single.step function to determine the time to fixation of a neutral allele for a model. Assumes that the curr.pop has been suitably initialised. Note that all parameters for the model, other than max.gens is the same as the model single.step. This runs the model once, whereas because of the stochastic nature of the model, you would need to run this model repeatedly to obtain a good mean and variance of the time to fixation.

Usage

1
2
3
fixation(max.gens = 200, curr.pop, move.table, survive.table, breed.table,
  habitat.list, crowd.table = NA, crowding.sigma = 0, max.dist = 5,
  trace.output = FALSE)

Arguments

max.gens

Maximum number of generations before the simulation halts.

curr.pop

The current population as a .ppp

move.table

Movement table as defined by movement.table.

survive.table

Survival table as defined by survival.table.

breed.table

Breeding table as defined by breeding.table

habitat.list

The list of habitats (probability) surfaces with associated N(m,sd).

crowd.table

The crowding table as defined by crowding.table

crowding.sigma

Bandwidth used for density calculation for crowding

max.dist

Maximum distance between breeding parents

trace.output

TRUE - write out generation details to console

Value

This function will complete when: (a) The alleles have fixed; (b) The maximum number of generations has been reached; or (c) The population has died out. To allow a simple method for distinguishing each of these cases, the model returns a 6 element numeric vector: <TRUE/FALSE fixed>, <generation>, <Final Population Count>, <Allele Sum> <#Males>,<#Females>. Note that fixation needs to be run many times for a good mean/variance estimate.


pwhigham/spatibm documentation built on Aug. 30, 2019, 1:16 p.m.