make_compositional_variance: Converts a covariance matrix to compositional form

Description Usage Arguments Details Value Author(s) Examples

View source: R/make_compositional.R

Description

Given a covariance matrix, removes multiplicative noise

Usage

1
2

Arguments

Sigma

the uncorrected covariance matrix

Details

The two functions use different methods. make_compositional_variance calculates the variance of compositional data that agrees with Sigma (viewed as a bilinear form) on compositional vectors. That is, the return value Sigma_c is a symmetric matrix which satisfies t(u)%*%Sigma_c%*%v=t(u)%*%Sigma%*%v for any compositional vectors u and v, and also rowSums(Sigma_c)=0.

Value

The compositionally corrected covariance matrix.

Author(s)

Toby Kenney tkenney@mathstat.dal.ca and Tianshu Huang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n<-10
p<-5

X<-rnorm(n*p)

dim(X)<-c(n,p)
Sigma<-t(X)%*%X/(n-1)

SigmaComp<-make_compositional_variance(Sigma)

SigmaCompMin<-make_compositional_min_var(Sigma)

PoissonPCA documentation built on Aug. 17, 2021, 5:09 p.m.