basis_shrinkage: Covariance Shrinkage and Partial Correlation Calculation

View source: R/1a-propr-backend.R

basis_shrinkageR Documentation

Covariance Shrinkage and Partial Correlation Calculation

Description

This function performs covariance shrinkage and calculates the partial correlation matrix based on the input count data matrix. The function can output the results in two formats: centered log-ratio (clr) or additive log-ratio (alr).

Usage

basis_shrinkage(M, outtype = c("clr", "alr"))

Arguments

M

A data matrix representing the counts. Each row should represent observations, and each column should represent different variables.

outtype

A character vector specifying the output type. It can take either "clr" (centered log-ratio) or "alr" (additive log-ratio).

Value

A matrix representing the partial correlation matrix.

Examples

# Sample input count data
data <- iris[,1:4]

# Calculate partial correlation matrix using clr transformation
result_clr <- basis_shrinkage(data, outtype = "clr")

# Calculate partial correlation matrix using alr transformation
result_alr <- basis_shrinkage(data, outtype = "alr")


tpq/propr documentation built on April 21, 2024, 12:50 p.m.