def __init__(self, Y, Cn, G, F=None, A=None, rank=1, Cr=None): """ Args: Y: [N, P] phenotype matrix F: Sample fixed effect design (first dimension must be N) A: Trait fixed effect design (second dimension must be P) Cn: Limix covariance matrix for Cn (dimension P) G: [N, rank_r] numpy covariance matrix for G rank: rank of column low-rank covariance (default = 1) """ assert_type(Y, NP.ndarray, 'Y') assert_subtype(Cn, Covariance, 'Cn') assert_type(G, NP.ndarray, 'G') covar = Cov2KronSumLR(Cn=Cn, G=G, rank=rank, Cr=Cr) mean = MeanKronSum(Y=Y, F=F, A=A) assert mean.n_terms <= 1, ('GP2KronSum supports MeanKronSum' ' means with maximum 1 term!') GP.__init__(self, covar=covar, mean=mean)
def __init__(self, Y, Cg, Cn, F=None, A=None, R=None, S_R=None, U_R=None): """ Args: Y: [N, P] phenotype matrix F: list of sample fixed effect designs. Each term must have first dimension N A: list of trait fixed effect design. Each term must have second dimension P Cg: Limix covariance matrix for Cg (dimension P) Cn: Limix covariance matrix for Cn (dimension P) R: [N, N] numpy semidemidefinite covariance matrix for R. In alternative to R, S_R and U_R can be specified. S_R: N vector of eigenvalues of R U_R: [N, N] eigenvector matrix of R """ assert_type(Y, NP.ndarray, 'Y') assert_subtype(Cg, Covariance, 'Cg') assert_subtype(Cn, Covariance, 'Cn') covar = Cov2KronSum(Cg=Cg, Cn=Cn, R=R, S_R=S_R, U_R=U_R) mean = MeanKronSum(Y=Y, F=F, A=A) GP.__init__(self, covar=covar, mean=mean)