Skip to contents

The function returns the covariance matrix for the multivariate normal distribution of lg_subject, l_subject, l_parent1, l_parent2, l_sibling1, ... ,l_siblingN

Usage

get_cov(h2, n_sib = 0)

Arguments

h2

The heritability of trait.

n_sib

Amount of siblings.

Value

Covariance matrix of datatype matrix.

Examples

get_cov(0.5, n_sib = 2)
#>      [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0.50 0.50 0.25 0.25 0.25 0.25
#> [2,] 0.50 1.00 0.25 0.25 0.25 0.25
#> [3,] 0.25 0.25 1.00 0.00 0.25 0.25
#> [4,] 0.25 0.25 0.00 1.00 0.25 0.25
#> [5,] 0.25 0.25 0.25 0.25 1.00 0.25
#> [6,] 0.25 0.25 0.25 0.25 0.25 1.00