conditionalG: Computing a conditional sub-matrix of G

Description Usage Arguments Details Value Author(s) References Examples

View source: R/conditionalG.R

Description

conditinoalG calculates a conditional variance matrix.

Usage

1
conditionalG(G, condition_on = NULL)

Arguments

G

A variance matrix (must be symmetric and positive definite).

condition_on

Either an integer with the column number indicating which trait to condition on or a vector with several column numbers (integers).

Details

The function calculates a sub-matrix of G conditional on the traits defined by the the condition_on vector. The function is based on equation 3 in Hansen et al. (2003).

Value

A matrix that is a sub-matrix of the input matrix conditional on the non-included traits.

Author(s)

Geir H. Bolstad

References

Hansen TF, Armbruster WS, Carlsson ML & PĂ©labon C. 2003. Evolvability and genetic constraint in Dalechampia blossoms: genetic correlations and conditional evolvability. J. Exp. Zool. 296B:23-39.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Constructing a G-matrix:
G <- matrix(c(
  1, 1, 0, 1,
  1, 2, 1, 1,
  0, 1, 2, 1,
  1, 1, 1, 3
), ncol = 4)

# Computing a conditional 2x2 sub-matrix by conditioning on
# trait 3 and 4:
G_sub_conditional <- conditionalG(G, condition_on = c(3, 4))
G_sub_conditional

# The average evolvabilities of this matrix can then be
# compared can than be compared to the average evolvabilities
# of the corresponding unconditional sub-matrix of G:
evolvabilityMeans(G_sub_conditional)
evolvabilityMeans(G[-c(3, 4), -c(3, 4)])

evolvability documentation built on Dec. 11, 2021, 9:34 a.m.