biglmmg: Fit a low-rank LMM on raw genotypes (no explicit scaling).

Description Usage Arguments Details Examples

View source: R/biglmmg.R

Description

Fit a low-rank LMM on raw genotypes (no explicit scaling).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
biglmmg(
  y,
  X,
  G,
  cols = seq(ncol(G)),
  M = length(cols),
  K = NULL,
  REML = TRUE,
  compute_mult = TRUE,
  verbose = 0
)

Arguments

y

A vector of trait values (quantitative trait).

X

A matrix of covariates. The default value is matrix of ones for the intercept (one column).

G

A FBM matrix of genotypes. Missing values are not handled.

cols

A vector of columns of G to be used in the model. By default, all columns of G are used.

M

A scalar for normalization of the genetic relationship matrix: GRM = Z'Z / M, where Z is a matrix of standardized genotypes. By default, M = length(cols).

K

A matrix with the pre-computed cross-product Z'Z / M. By default, K = NULL, that means K is pre-computed inside the function.

REML

A boolean specifying the likelihood function, REML or ML.

compute_mult

A boolean enabling the computation of the effective sample size, when only model fitting is needed. The default value is TRUE.

verbose

The verbose level. The default value is 0 (verbose).

Details

The linear mixed model (LMM) is: y_i = X_i b + u_i + e_i, where

u ~ N(0, s2*h2*G) and e ~ N(0, s2 I)

var(y) = V = s2 * (h2*G + I)

Examples

1
2
3
4
5
6
7
8
9
G <- attach_example200() # load simulated genotypes
G
G[1:5, 1:10]

y <- rnorm(nrow(G)) # generate a random phenotype
head(y)

mod <- biglmmg(y, G = G)
mod$gamma # estimated h2

variani/biglmmz documentation built on Dec. 15, 2020, 7:58 a.m.