cov_pca: Perform PCA on data and return list of candidate covariance...

View source: R/data2cov.R

cov_pcaR Documentation

Perform PCA on data and return list of candidate covariance matrices

Description

Perform PCA on data and return list of candidate covariance matrices

Usage

cov_pca(data, npc, subset = NULL)

Arguments

data

a mash data object

npc

the number of PCs to use

subset

indices of the subset of data to use (set to NULL for all data)

Value

Returns a list of covariance matrices: the npc rank-one covariance matrices based on the first npc PCs, and the rank npc covariance matrix. If flashier did not identify any factors, NULL is returned.

Examples

data = mash_set_data(Bhat = cbind(c(1,2),c(3,4)), Shat = cbind(c(1,1),c(1,1)))
cov_pca(data,2)


mashr documentation built on Oct. 18, 2023, 5:08 p.m.