Learn R Programming

lmf (version 1.2)

nfs: Estimate temporal coefficients of selection assuming no fluctuating selection

Description

nfs is a function which estimates the temporal covariance matrix and the temporal mean alpha coefficients (i.e. directional selection) under the assumption of no fluctuating selection.

Usage

nfs(At, at, npar, nyear)

Arguments

At
a list containing the named yearly variance-covariance matrices. Sorted by year.
at
a list containing the named yearly vectors of the estimated selection coefficients. Sorted by year.
npar
the number of parameters in the model for the estimates selection coefficients.
nyear
the number of years with estimates of selection.

Value

nfs returns a list containing the following components:
Anf
the estimated temporal covariance matrix under the assumption of no flucutating selection.
anf
the estimated temporal mean selection coefficients under the assumption of no fluctuating selection.

Details

nfs is used internally in lmf when estimating temporal mean coefficients of selection under the assumption of no fluctuating selection, but given the right data can be executed as a standalone. The input to the arguments At and at are estimated within lmf by correctly combining estimates of coefficients and variance-covariance within each age class and year to a estimate for each year.

Engen et al. 2012 describe the method in details.

References

Engen, S., Saether, B.-E., Kvalnes, T. and Jensen, H. 2012. Estimating fluctuating selection in age-structured populations. Journal of Evolutionary Biology, 25, 1487-1499.

See Also

lmf, fs

Examples

Run this code
#Data set from Engen et al. 2012
data(sparrowdata)
#Fit model
lmf.1 <- lmf(formula = cbind(recruits, survival) ~ weight + tars,
               age = age, year = year, data = sparrowdata)
#Extract At and at
At <- lmf.1$At
at <- lmf.1$at
#Estimate temporal selection coefficients under the assumption of no
  #fluctuating selection
noflusel <- nfs(At = At, at = at, npar = 3, nyear = 7)
#View output
str(noflusel)
noflusel

Run the code above in your browser using DataLab