Heritability estimation

Heritability

limix.heritability.estimate(pheno, lik, K, covs=None, verbose=True)[source]

Estimate the so-called narrow-sense heritability.

It supports Normal, Bernoulli, Binomial, and Poisson phenotypes. Let \(N\) be the sample size and \(S\) the number of covariates.

Parameters:
  • pheno (tuple, array_like) – Phenotype. Dimensions \(N\\times 0\).
  • lik ({'normal', 'bernoulli', 'binomial', 'poisson'}) – Likelihood name.
  • K (array_like) – Kinship matrix. Dimensions \(N\\times N\).
  • covs (array_like) – Covariates. Default is an offset. Dimensions \(N\\times S\).
Returns:

Estimated heritability.

Return type:

float

Examples

>>> from numpy import dot, exp, sqrt
>>> from numpy.random import RandomState
>>> from limix.heritability import estimate
>>>
>>> random = RandomState(0)
>>>
>>> G = random.randn(50, 100)
>>> K = dot(G, G.T)
>>> z = dot(G, random.randn(100)) / sqrt(100)
>>> y = random.poisson(exp(z))
>>>
>>> print('%.2f' % estimate(y, 'poisson', K, verbose=False))
0.70