hamsta.preprocess.SVD#

hamsta.preprocess.SVD(A, Q=None, LAD=None, k=None)#

SVD, with covariate and output options.

When k is set, run truncated SVD in scikit learn.
Else, compute all the components with jax SVD
Parameters
  • A (Array) – local ancestry matrix (marker, sample)

  • Q (Optional[Array]) – global ancestry or covariates to be projected (sample, n_covariate)

  • LAD (Optional[Array]) – local ancestry correlation matrix (marker, marker)

  • k (Optional[int]) – number of components computed in truncated

Returns

E501

Return type

(U, S) in SVD of X = U * S @ Vh, where X is A/sqrt(N) with A standardized # noqa