Description Usage Arguments Value Note Author(s) References See Also Examples
View source: R/fitness.landscape2.R View source: R/fitness.landscape.R
fitness.landscape()
takes a fitness function, i.e., the relationship between fitness and indivdiual phenotype, as characterized using the function gam()
from the package mgcv, and calculates a corresponding fitness landscape in one or two dimensions
1 2 3 4 |
mod |
a gam object. Must include predictor variables specified by |
phenotype |
a vector of one or two character strings specifying predictor variables in |
covariates |
a character vector listing any covariates in the model |
points |
(optional) a matrix, array, or data frame with traits in columns and points in rows, specifying the series of points at which to evaluate the estimated fitness landscape. If missing, the fitness landscape is evaluated at points from one standard deviation below, to one standard deviation above the mean values, at as many points as specified by |
plt.density |
(optional) the number of points (per phenotypic trait) at which to evaluate the fitness landscape. only used if |
PI.method |
the method by which to obtain a prediction interval for the fitness landscape. Options are 'n' for none, 'boot.para' for parametric bootstrapping, and 'boot.case' for case bootstrapping. |
PI.interval |
the upper and lower bounds of the prediction interval. Defaults to c(0.5, 0.75) in order to generate a prediction interval that is interpretable similarly to a standard error. |
n.boot |
number of bootstrap replicates for evaluating the prediction interval of the fitness landscape |
refit.smooth |
whether or not to re-estiamte smoothing parameters when |
parallel |
whether or not to use parallel processing to speed up computation of bootstrap prediction intervals. Default in 'no' for no parallel computing. Under linux only, |
ncpus |
the number of cpus to be used for parallel processing of bootstrap prediction intervals. Only used under linux. |
$points |
the points at which the fitness landscape was evaluated |
$Wbar |
population mean absolute fitness at |
$WbarPI |
bounds of the prediction interval of |
Fitness landscapes are hypothetical constructs used to provide a visual representation of the magnitude of selection. Care must be taken in the interpretation of these landscapes as the increase population mean fitness that would actually be realized from a given amount of selection. This is because there are many assumptions, such as independence of evolution of the mean and variance, which are in fact likely to scale together, lack of density dependence of population growth (i.e. fitness), the assumption that evolution of the trait itself does not change the environment, etc.
Michael Morrissey michael.morrissey@st-andrews.ac.uk
M.B. Morrissey and K. Sakrejda. 2013. Unification of regression-based methods for the analysis of natural selection. Evolution 67: 2094-2100.
gam.gradients,moments.differentials,gam
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # simulated data (stabilizing selection)
z<-rnorm(200,0,2)
W<-rpois(200,exp(1-1*z^2))
d<-as.data.frame(list(W=W,z=z))
# characterize the fitness function
library(mgcv)
ff<-gam(W~s(z),family='poisson',data=d)
# characterize fitness landscape
fl<-fitness.landscape(mod=ff,phenotype="z",PI.method='n')
# (not run) plotting
# plot(fl$points[,1],fl$Wbar,type='l')
# lines(fl$points[,1],fl$WbarPI[1,],lty='dashed')
# lines(fl$points[,1],fl$WbarPI[2,],lty='dashed')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.