asreml.monte | R Documentation

## Calculate an inverse relationship matrix

### Description

Calculate relationship matrices by monte-carlo simulation from a pedigree data frame.

### Usage

    asreml.monte(pedigree, fgen = list(character(0), 0), nsim = 2000,
                 rm = c("A", "D", "C", "Ct", "Dh", "Di", "E"),
                 form = c("full", "lower"), mv = c("NA", "0", "*"),
                 psort = FALSE)

### Arguments

`pedigree` | a data frame with (at least) three columns that correspond to the individual, male parent and female parent, respectively. The row giving the pedigree of an individual must appear before any row where that individual appears as a parent. Founders use 0 (zero) or NA in the parental columns.
`fgen` | an optional list of length 2 where `fgen[[1]]` is a character string naming the column in `pedigree` that contains the level of selfing or the level of inbreeding of an individual. In `pedigree[,fgen[[1]]]`, 0 indicates a simple cross, 1 indicates selfed once, 2 indicates selfed twice, etc. A value between 0 and 1 for a base individual is taken as its inbreeding value. If the pedigree has implicit individuals (they appear as parents but not as individuals), they will be assumed base non-inbred individuals unless their inbreeding level is set with `fgen[[2]]` where `0 < fgen[[2]] < 1` is the inbreeding level of such individuals.
`nsim` | the number of iterations, or traversals of the pedigree used in the simulation (default = 2000).
`rm` | a character vector nominating the required relationship matrices. By default all matrices are returned (see the details section).
`form` | the default `full` returns the relationships in standard matrix objects, while `upper` implies .
`mv` | missing value indicator; elements of `pedigree` that exactly match `mv` are treated as missing.
`psort` | if TRUE, the pedigree data frame is returned in founder order after any insertions and permutations

### Details

`asreml.monte` uses the method of Meuwissen and Luo (1992) to compute the inverse relationship matrix directly from the pedigree.

### Value

a list with the following components:

`ginv` | a data frame with 3 columns holding the lower triangle of the inverse relationship matrix in sparse form. The first 2 columns are the row and column indices of the matrix element, respectively, and the third column holds the (inverse) matrix element itself. Sort order is columns within rows, that is, the lower triangle row-wise. This data frame has an attribute `rowNames` containing the vector of identifiers for the rows matrix.
`inbreeding` | the inbreeding coefficient for each individual, calculated as `diag(A-I)`.
`det` | the log determinant.

### Author(s)

David Butler

### References

Fernando, R. and Grossman, M. (1990). Genetic evaluation with autosomal and x-chromosomal inheritance, Theoretical and Applied Genetics, 80, 75-80.

Meuwissen, T. H. E., and Luo, Z. (1992) Computing inbreeding coefficients in large populations. Genetics Selection Evolution, 24, 305-313.

### See Also

`asreml.control`

### Examples

    ## Example 1. Simple pedigree

    pdf <- data.frame(me = c(1,2,3,4,5,6,7,8,9,10),
                      dad = c(0,0,0,1,1,2,4,5,7,9),
                      mum = c(0,0,0,1,1,2,6,6,8,9))
    p.ai <- asreml.monte(pdf)$ginv

    ## Example 2. Known filial generation

    pdfg <- data.frame(me = c(1,2,3,4,5,6,7),
                       dad = c(0,0,1,1,1,1,1),
                       mum = c(0,0,0,2,2,2,2),
                       fgen = c(0.8,0.0,2.0,0.0,2.0,3.0))
    pdfg.a <- asreml.monte(pdfg,fgen=list('fgen',0.4))
    pdfg.ai <- pdfg.a$ginv
    pdfg.mat <- asreml.sparse2mat(pdfg.ai)
    zapsmall(solve(pdfg.mat))
    zapsmall(cbind(pdfg.a$inbreeding,diag(pdfg.mat)))