Skip to contents

Estimates a covariance matrix from a data matrix Y using empirical Bayes matrix factorization (flashier::flash). When the FLASH fit finds no shared factors, the returned covariance is diagonal with entries residuals_sd^2; otherwise the factor contribution is added. FLASH errors are not caught; callers should handle them explicitly or supply a pre-computed prior covariance instead.

Usage

computeCovFlash(Y)

Arguments

Y

Numeric matrix (samples x conditions).

Value

A covariance matrix of dimension ncol(Y) x ncol(Y), rescaled by the column standard deviations of Y.