calc_svd_entropy_importance: Singular Value Decomposition (SVD) Analysis of Networks

View source: R/svdcentrality.R

calc_svd_entropy_importanceR Documentation

Singular Value Decomposition (SVD) Analysis of Networks

Description

This function performs Singular Value Decomposition (SVD) on a network adjacency matrix. It computes species importance based on the dominant singular values and returns entropy, rank, and key visualizations.

Usage

calc_svd_entropy_importance(A, threshold_factor = 1e-06)

Arguments

A

A square adjacency matrix where rows represent prey and columns represent predators. The values represent interaction strengths.

Value

A list containing:

Rank

The numerical rank of the matrix after small values are rounded for numerical stability.

Entropy

The entropy of the singular value distribution.

Prey_Importance

A data frame ranking prey species by their contribution to the largest singular value.

Predator_Importance

A data frame ranking predator species by their contribution to the largest singular value.

Singular_Values

A numeric vector of the singular values of the matrix.

Plot_Singular_Values

A ggplot object showing the distribution of singular values.

Plot_Prey_Importance

A ggplot object showing the top prey species contributing to the largest singular value.

Plot_Predator_Importance

A ggplot object showing the top predator species contributing to the largest singular value.

Examples


results <- calc_svd_entropy_importance(netData[[1]])
print(results$Rank)
print(results$Entropy)
print(results$Plot_Singular_Values)
print(results$Plot_Prey_Importance)
print(results$Plot_Predator_Importance)


lsaravia/EcoNetwork documentation built on April 5, 2025, 1:51 p.m.