Learn R Programming

exactLTRE (version 0.1.2)

make.Gmatrix: G-matrix

Description

The G-matrix is the operator used for calculating a vector of effects from a vector of responses, up to arbitrary interaction order. This recursive function for building up the G-matrix is presented in a paper about genetic epistasis from Poelwijk, Krishna, and Ranganathan (2016, PLOS Comp Bio tools:::Rd_expr_doi("10.1371/journal.pcbi.1004771")). When the G-matrix is multiplied on the right by a column vector of the observed responses, it will produce a column vector of the effects. In other words, the G-matrix adds and subtracts off the appropriate lower-order terms to arrive at the correct values of interaction effects.

Usage

make.Gmatrix(n)

Value

A matrix that is 2^n-by-2^n.

Arguments

n

The number of observed parameters, mutation sites, etc.

Examples

Run this code
Gmat<- make.Gmatrix(3)

Run the code above in your browser using DataLab