ptof_fgm_iso: Generates the fitness corresponding to the phenotypic...

Description Usage Arguments Value Examples

View source: R/ptof_fgm_iso.R

Description

Generates the fitness corresponding to the phenotypic coordinates of phenotype using Fisher's Geometric Model (FGM, Fisher (1930)). Use the fitness function of an isotrope FGM (with parameters n, maxfitness, alpha, Q) to compute the fitness (malthusian fitness) of phenotype(s) log(W) = \code(maxfitness)- \code{alpha} * \code{phenotype}^(\code{Q}/2) (see Tenaillon et al. (2007)) See also ftop_fgm_iso for inverse function.

Usage

1
2
ptof_fgm_iso(phenotype, maxfitness, alpha = 1/2, Q = 2,
  pheno_opt = numeric(dim(phenotype)[2]))

Arguments

phenotype

A vector, matrix of real number(s) (phenotypic coordinate(s)). For a matrix or a data.frame, the rows are phenotypes and the columns phenotypic dimensions.

maxfitness

A real number. The maximum fitness in the landscape. The fitness at the phenotypic optimum (pheno_opt).

alpha

A strictly positive real number. Scaling factor for the fitness function. Default=1/2 in the cannonical FGM with a quadratic fitness function.

Q

A strictly positive number. "Shape" of the fitness function. Default=2 in the cannonical FGM with a quadratic fitness function.

pheno_opt

A vector of coordinates for the position of the phenotypic optimum at which the fitness is equal to maxfitness. Its length must be equal to n. Default = numeric(n).

Value

A vector of fitnesses of length equal to the number of phenotype(s) (row(s)) in phenotype

Examples

1
2
3
4
#' @examples
ptof_fgm_iso(phenotype = matrix(1:9, 3, 3, byrow = TRUE), maxfitness = 1)
ptof_fgm_iso(phenotype = matrix(1:9, 3, 3, byrow = TRUE), maxfitness = 1,
alpha = 1/2, Q = 2, pheno_opt = c(1,1,1))

YoannAnciaux/inferenceFitnessLandscape documentation built on Oct. 31, 2019, 1:19 a.m.