Simulating more complex mating systems

knitr::opts_chunk$set(echo = TRUE)

The easiest simulations to parameterize in rmetasim are ones in which hermaphroditic individuals are simulated. This works really well in the majority of cases. There are times, however, where simulating more complex sexuality and mating is required. No problem, but more complex sexuality means more complex parameterization.

I find that drawing a picture that illustrates the fate of individuals each time-click is very helpful

Hermaphrodites

The following figure illustrates a simple life-cycle.

A simple life cycle with hermaphroditic adults

The local demography matrices that encode this demography look like this (remember transitions go from columns to rows):

LocalS = matrix(c(0, 0, 0.6, 0.85),byrow=T,ncol=2)
LocalR = matrix(c(0, 1, 0, 0),byrow=T,ncol=2)
LocalM = matrix(c(0, 0, 0, 1),byrow=T,ncol=2)

print("LocalS:")
LocalS
print("LocalR:")
LocalR
print("LocalM:")
LocalM

Dioecy with equal probability of producing males and females from a mating

A simple life cycle with dioecy

Here are the local-demographic matrices. Now there are 4 stages within a population: male juveniles (1), male adults(2), female juveniles(3) and female adults (4)

LocalS = matrix(c(0, 0, 0, 0,
                  0.5,  0.75, 0, 0,
                  0, 0, 0, 0,
                  0, 0, 0.6, 0.85),byrow=T,ncol=4)

LocalR = matrix(c(0, 0, 0, 0.5,
                  0,  0, 0, 0,
                  0, 0, 0, 0.5,
                  0, 0, 0, 0),byrow=T,ncol=4)

LocalM = matrix(c(0, 0, 0, 0,
                  0,  0, 0, 1,
                  0, 0, 0, 0,
                  0, 0, 0, 0),byrow=T,ncol=4)

print("LocalS:")
LocalS
print("LocalR:")
LocalR
print("LocalM:")
LocalM

One could imagine additional elements in the LocalS matrix that might encode changes in sexuality during the course of an individual's life.



Try the rmetasim package in your browser

Any scripts or data that you put into this service are public.

rmetasim documentation built on Feb. 16, 2018, 1:01 a.m.