sim_multiphylo: Quantitative genetics-based simulation of multivariate...

View source: R/sim_multiphylo.R

sim_multiphyloR Documentation

Quantitative genetics-based simulation of multivariate evolution.

Description

Simulates evolution using Lande's multivariate breeder's equation.

Usage

sim_multiphylo(
  G,
  phy,
  n.s,
  selection = "random",
  efsize = 0,
  gen_time = 1e-06,
  Nef = 1000,
  Nef_osc = "no",
  matrix = TRUE,
  Nef_par = NULL,
  scale = FALSE,
  means = NULL
)

Arguments

G

matrix kxk for k number of traits.

phy

a phylogenetic tree. Must be of class 'phylo'.

n.s

a vector indicating the sample sizes for each terminal.

selection

define the type oif selection "random" or numeric between 1 and k.

efsize

strenght of selection relative to drif. Must be >= 0.

gen_time

generation time in the same time unity as the phylogenetic tree (usually MY).

Nef

effective population size for initial population. Must be >= 1.

Nef_osc

oscilation in effective population size (Nef) over time. Character "no", "norm", or "unif".

matrix

logic TRUE of FALSE. Should the output be a set of marices? See 'Value' for more details.

Nef_par

set parameters for the oscilation of effective population size (Nef).

scale

logic TRUE of FALSE. Should the matrices be scaled to the empirical character values (means)?

means

matrix sxk containing the empirical means of all k characters for each species (s). Default = NULL.

Value

The 'sim_multiphylo' function returns an object of class "list". This is a list of items of class "matrix", all kxk. If 'matrix' = TRUE, the function returns 5 variance covariance matrices:

R

Evolutionary rate matrix. Describes the rate of evolution and co-evolution among characters. Diagonal contains traits' rate evolution according to Brownian-Motion, off diagonals represent traits co-evolution.

W

Within matrix. Pooled-within species' trait variance-covariance matrix.

B

Between matrix. Variance-vovariance between average species traits.

G

Genetic matrix. The original aditive variance-covariance G matrix imputed.

A

Selection matrix. The expected effect due to selection.

If 'matrix' = FALSE, the function returns 3 matrices:

bdata

Simulated trait values for species averages.

wdata

Simulated intraspecific error.

G

the original aditive variance-covariance G matrix imputed.


FabioLugar/mvEvol documentation built on Dec. 21, 2024, 7:25 p.m.