Learn R Programming

Reacnorm (version 0.2.1)

rn_cs_gen: 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)

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).

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)

Author

Pierre de Villemereuil

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.

See Also

rn_vgen, rn_gen_decomp

Examples

Run this code
G <- diag(10)

rn_cs_gen(G_cs = G)

Run the code above in your browser using DataLab