dc_stat_think.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:dc_stat_think 作者: justinbois 项目源码 文件源码
def heritability(parents, offspring):
    """
    Compute the heritability from parent and offspring samples.

    Parameters
    ----------
    parents : array_like
        Array of data for trait of parents.
    offspring : array_like
        Array of data for trait of offspring.

    Returns
    -------
    output : float
        Heritability of trait.
    """
    par, off = _convert_two_data(parents, offspring)
    covariance_matrix = np.cov(par, off)
    return covariance_matrix[0,1] / covariance_matrix[0,0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号