Learn R Programming

jaatha (version 2.7.0)

dm.addSizeChange: Adds an instantaneous change of the population size of one population to a model.

Description

This function changes the effective population size of one population. The change is performed at a given time point ('at.time') and applies to the time interval farther into the past from this point. The population size is set to a fraction of N0, the present day size of population one.

Usage

dm.addSizeChange(dm, min.size.factor, max.size.factor, fixed.size.factor,
  par.new = T, new.par.name = "q", parameter, population, at.time = "0")

Arguments

dm
The demographic model to which the size change should be added.
min.size.factor
If you want to estimate the size factor, this will be used as the smallest possible value.
max.size.factor
Same as min.size.factor, but the largest possible value.
fixed.size.factor
If specified, the size factor not be estimated, but assumed to have the given value.
par.new
If 'TRUE' a new parameter will be created using the arguments 'min.size.factor' and 'max.size.factor' or 'fixed.size.factor'. It will be named 'new.time.point.name' If 'FALSE' the argument 'parameter' will be evaluated instead.
new.par.name
Name for the new parameter.
parameter
Instead of creating a new parameter, you can also set the mutation rate to an expression based on existing parameters. For example setting this to "tau" will use an parameter with name tau that you have previously created. You can also use R expression he
population
The number of the population in which the spilt occurs. See dm.addSpeciationEvent for more information.
at.time
The time point at which the size changes.

Value

  • The demographic model with a size change.

Details

If you want to add a slow, continuous change over some time, then use the dm.addGrowth function.

Examples

Run this code
# A model with one smaller population
dm <- dm.createThetaTauModel(c(20,37), 88)
dm <- dm.addSizeChange(dm, 0.1, 1, population=2, at.time="0")

Run the code above in your browser using DataLab