rn_cs_gen: Decompose the \mathbf{G}-matrix from a character-state model

View source: R/rn_gen.R

rn_cs_genR Documentation

Decompose the \mathbf{G}-matrix from a character-state model

Description

This function takes the \mathbf{G}-matrix estimated from a character-state model and returns the values for V_{\text{Add}}, V_{\text{A}}, V_{\text{A}\times\text{E}} and n_{\text{eff}}

Usage

rn_cs_gen(G_cs, wt = NULL)

Arguments

G_cs

(Additive) genetic variance-covariance matrix estimated from a character-state model (i.e. where environments are treated as a categorical variable). (numerical matrix)

wt

Weights to apply to the different environments, e.g. reflecting their frequencies in the wild. The weights must non-negative, and at least one must be non-zero. The vector wt must be the same length as the rows and columns of G_cs. By default, no weighting is applied. (numeric)

Details

V_{\text{Add}} is the (weighted) average of the diagonal elements of G_cs, V_{\text{A}} is the (weighted) average of all the elements of G_cs and V_{\text{A}\times\text{E}} is the difference between V_{\text{Add}} and V_{\text{A}}. Finally, the efficient number of dimensions n_{\text{eff}} is the ratio of the sum of the eigen values of G_cs over its maximum eigen value. Note that n_{\text{eff}} is returned for information, but is expected to be biased in practice due to an over-estimation of the maximum eigen value.

Value

This function yields V_{\text{Add}}, V_{\text{A}}, V_{\text{A}\times\text{E}} and n_{\text{eff}} as a one-row data.frame (data.frame, all numeric).

Author(s)

Pierre de Villemereuil

See Also

rn_vgen, rn_gen_decomp

Examples

G <- diag(10)

rn_cs_gen(G_cs = G)

Reacnorm documentation built on April 3, 2025, 9:24 p.m.