Kron2Sum

class glimix_core.lmm.Kron2Sum(Y, A, X, G, rank=1, restricted=False)[source]

LMM for multi-traits fitted via maximum likelihood.

This implementation follows the work published in [CA05]. Let n, c, and p be the number of samples, covariates, and traits, respectively. The outcome variable Y is a n×p matrix distributed according to:

vec(Y) ~ N((A ⊗ X) vec(B), K = C₀ ⊗ GGᵀ + C₁ ⊗ I).

A and X are design matrices of dimensions p×p and n×c provided by the user, where X is the usual matrix of covariates commonly used in single-trait models. B is a c×p matrix of fixed-effect sizes per trait. G is a n×r matrix provided by the user and I is a n×n identity matrices. C₀ and C₁ are both symmetric matrices of dimensions p×p, for which C₁ is guaranteed by our implementation to be of full rank. The parameters of this model are the matrices B, C₀, and C₁.

For implementation purpose, we make use of the following definitions:

  • 𝛃 = vec(B)

  • M = A ⊗ X

  • H = MᵀK⁻¹M

  • Yₓ = LₓY

  • Yₕ = YₓLₕᵀ

  • Mₓ = LₓX

  • Mₕ = (LₕA) ⊗ Mₓ

  • mₕ = Mₕvec(B)

where Lₓ and Lₕ are defined in glimix_core.cov.Kron2SumCov.

References

CA05

Casale, F. P., Rakitsch, B., Lippert, C., & Stegle, O. (2015). Efficient set tests for the genetic analysis of correlated traits. Nature methods, 12(8), 755.

__init__(Y, A, X, G, rank=1, restricted=False)[source]

Constructor.

Parameters
  • Y ((n, p) array_like) – Outcome matrix.

  • A ((n, n) array_like) – Trait-by-trait design matrix.

  • X ((n, c) array_like) – Covariates design matrix.

  • G ((n, r) array_like) – Matrix G from the GGᵀ term.

  • rank (optional, int) – Maximum rank of matrix C₀. Defaults to 1.

Methods

__init__(Y, A, X, G[, rank, restricted])

Constructor.

covariance()

Covariance K = C₀ ⊗ GGᵀ + C₁ ⊗ I.

fit([verbose])

Maximise the marginal likelihood.

get_fast_scanner()

Return FastScanner for association scan.

gradient()

Gradient of the log of the marginal likelihood.

lml()

Log of the marginal likelihood.

mean()

Mean 𝐦 = (A ⊗ X) vec(B).

value()

Log of the marginal likelihood.

Attributes

A

A from the equation 𝐦 = (A ⊗ X) vec(B).

B

Fixed-effect sizes B from 𝐦 = (A ⊗ X) vec(B).

C0

C₀ from equation K = C₀ ⊗ GGᵀ + C₁ ⊗ I.

C1

C₁ from equation K = C₀ ⊗ GGᵀ + C₁ ⊗ I.

M

M = (A ⊗ X).

X

X from equation M = (A ⊗ X).

beta

Fixed-effect sizes 𝛃 = vec(B).

beta_covariance

Estimates the covariance-matrix of the optimal beta.

name

Name of this function.

ncovariates

Number of covariates, c.

nsamples

Number of samples, n.

ntraits

Number of traits, p.