Last data update: 2014.03.03

R: Inverse Relatedness Matrix and Phylogenetic Covariance Matrix
inverseAR Documentation

Inverse Relatedness Matrix and Phylogenetic Covariance Matrix

Description

Henderson (1976) and Meuwissen and Luo (1992) algorithm for inverting relatedness matrices, and Hadfield and Nakagawa (2010) algorithm for inverting phylogenetic covariance matrices.

Usage

  inverseA(pedigree=NULL, nodes="ALL", scale=TRUE, reduced=FALSE)

Arguments

pedigree

ordered pedigree with 3 columns: id, dam and sire, or a phylo object.

nodes

"ALL" calculates the inverse for all individuals/nodes. For phylogenies "TIPS" calculates the inverse for the species tips only, and for pedigrees a vector of id's can be passed which inverts the relatedness matrix for that subset.

scale

logical: should a phylogeny (needs to be ultrametric) be scaled to unit length (distance from root to tip)?

reduced

logical: should childless nodes be dropped from the inverse and the pedigree/phylogeny representation be reduced?

Value

Ainv

inverse as sparseMatrix

inbreeding

inbreeding coefficients/branch lengths

pedigree

pedigree/pedigree representation of phylogeny

Author(s)

Jarrod Hadfield j.hadfield@ed.ac.uk

References

Henderson, C.R. (1976) Biometrics 32 (1) 69:83

Quaas, R. L. and Pollak, E. J. (1980) Journal of Animal Science 51:1277-1287.

Meuwissen, T.H.E and Luo, Z. (1992) Genetic Selection Evolution 24 (4) 305:313

Hadfield, J.D. and Nakagawa, S. (2010) Journal of Evolutionary Biology 23 494-508

Examples

data(bird.families)
Ainv<-inverseA(bird.families)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MCMCglmm)
Loading required package: Matrix
Loading required package: coda
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MCMCglmm/inverseA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: inverseA
> ### Title: Inverse Relatedness Matrix and Phylogenetic Covariance Matrix
> ### Aliases: inverseA
> ### Keywords: array
> 
> ### ** Examples
> 
> data(bird.families)
> Ainv<-inverseA(bird.families)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>