compute_diversity_graph: Compute the manual diversity graph D (Eq. (7) in the paper)

View source: R/dpage.R

compute_diversity_graphR Documentation

Compute the manual diversity graph D (Eq. (7) in the paper)

Description

For each pair of samples (x_i, x_j), the entry d_{ij} in the diversity matrix D is:

d_{ij} = \begin{cases} \frac{1}{2}\left( e^{\|x_i - x_j\|^2 / \rho_i^+} + e^{\|x_j - x_i\|^2 / \rho_j^+} \right), & \text{if } c_i = c_j, \\ \frac{1}{2}\left( e^{\|x_i - x_j\|^2 / \rho_i^-} + e^{\|x_j - x_i\|^2 / \rho_j^-} \right), & \text{if } c_i \neq c_j, \end{cases}

where \rho_i^+ and \rho_i^- follow Eqs. (5) and (6) but with q=0.

Usage

compute_diversity_graph(X, y)

Arguments

X

A numeric matrix of size n \times d.

y

A length-n vector/factor of class labels.

Value

An n \times n matrix D.


bbuchsbaum/discursive documentation built on April 14, 2025, 4:57 p.m.