fitness | R Documentation |

This function computes a fitness value (*ω*) depending on the phenotype (z) of individuals. The relationship between both variables is assumed to be Gaussian.

fitness(z, N, b0, b1, b2, b3, d.v, add.loci)

`z` |
A data.frame with the phenotype value ('z') and the sex of each individual in a population. |

`N` |
Population size of the population. |

`b0` |
A numerical value defining the maximum number of offspring that may be generated by a breeding pair. |

`b1` |
A numerical value defining the phenotypic optima of a given population (see Details). |

`b2` |
A numerical value defining the variance of the Gaussian curve. |

`b3` |
A numerical value defining the intensity of the density-dependence on the fitness of individuals in a population of size 'N'. |

`d.v` |
A numerical value defining a stochastic demographic variant in the fitness of individuals. |

`add.loci` |
An integer with the total number of additive loci participating in the computation of phenotypes. |

This function is used internally in the function evolve() of type 'selection' in order to compute the fitness value of individuals.

The value of 'b1' represents the *z* value expected to produce the maximum number of offspring.
The difference in phenotypic optima between the populations drives the strength of 'divergent selection'. Populations exposed to equal phenotypic optima are considered to be under 'concordant selection'.

This fitness function (*ω*) has the following form:

*ω = b_0 \exp^{ -\frac{1}{2} ≤ft ( \frac{4z - b_1n_a}{b_2n_a} \right )^2} - b_3N + \varepsilon_d(0, σ_d )*

Where *n_a* is equal to 'add.loci', *N* is the population size and *σ_d* is equal to 'd.v'. The demographic variant *\varepsilon_d* is assumed to be stochastic and normally distributed, with a mean of 0 and standard variation 'd.v'.

A vector with the fitness value (*ω*) for each individual.

Quilodrán, C. S., Ruegg, K., Sendell-Price, A. T., Anderson, E., Coulson, T. and Clegg, S. (2019).
The multiple population genetic and demographic routes to islands of genomic divergence.
*bioRxiv*.
doi: 10.1101/673483.

`evolve`

`phenotype`

## We first create a random population with 100 individuals and 10 loci N <- 100 # Population size nl <- 10 # Number of additive loci na <- 4 # Number of alleles per locus G <- initial.struct(N,nl,na) ## Additional parameters are needed for the computation of phenotypes bvs <- t(array( seq(0,1, length = na) ,c(na, nl))) sex.ratio <- 0.5 e.v=0.01 ## Now we compute the additive phenotype value of individuals phen <- phenotype(G, bvs, nl, sex.ratio, e.v) ## Additional parameters are needed for the fitness function b0 <- 6 b1 <- 0.25 b2 <- 0.5 b3 <- 0.01 d.v = 1 ## The fitness values of individuals are computed as follows: fitness(phen, N, b0, b1, b2, b3, d.v, nl)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.