Estimates Covariance betweeen and withing two datasets accounting for multinomial count uncertainty/error. Returns covariance with respect to CLR coordinates, this can easily be converted to alternative representations. See vignette for details.

teacup_cerberus(Y1, Y2, alpha1 = NULL, alpha2 = NULL,
  n_samples = 2000)

Arguments

Y1

count data (D1 x N) (e.g., taxa x samples)

Y2

count data (D2 x N) (e.g., food x samples)

alpha1

D1-vector prior for Dirichlet for Y1 (think of it as a "pseudo-count" like thing, must be greater than zero) default: rep(1, D1)

alpha2

D2-vector prior for Dirichlet for Y2 (think of it as a "pseudo-count" like thing, must be greater than zero) default: rep(1, D2)

Value

Array Sigma of dimension (D1+D2) x (D1+D2) x n_samples (Sample of Covariance Matricies)

Details

This fits the following model $$Y_1 ~ Multinomial(\pi_1)$$ $$Y_2 ~ Multinomial(\pi_1)$$ $$\pi_1 ~ Dirichlet(\alpha_1)$$ $$\pi_2 ~ Dirichlet(\alpha_2)$$ and then transforming posterior samples of that model via $$\eta_1 = CLR^{-1}(\eta_1)$$ $$\eta_2 = CLR^{-1}(\eta_2)$$ and then the s-th sample of Sigma (as a correlation matrix is given by) $$\Sigma^s = cov(cbind(\eta_1^s, \eta_2^s))$$