Information-Dense Centroid Metrics

Traditional central tendency and dispersion measures such as the mean and standard deviation can be misleading for multimodal or outlier-contaminated data. This package implements information-theoretic alternatives that weight observations by their local probability density, focusing on the region containing the bulk of the data. The core functions include ic_weights() for kernel density or histogram based entropy weighting, ic_center() and ic_dispersion() for weighted location and spread, ic_combined() for a single information density score between zero and one, and ic_plot() for visualization.


infocentroid: Information-Dense Centroid Metrics

infocentroid is an R package that provides information-theoretic alternatives to classical central tendency and dispersion metrics. While classical statistics (mean and standard deviation) are highly sensitive to outliers and multimodal distributions, the Information-Dense Centroid (IDC) focuses on the actual probability density of the data, capturing the region where the bulk of the information resides.

Methodology

In real-world data, distributions are often skewed, bimodal, or contaminated with outliers. A standard mean might fall into a "valley" where no actual data points exist. The IDC method uses Kernel Density Estimation (KDE) or histograms to assign entropy-based weights to each observation, ensuring that the calculated center reflects the true information density.

Empirical Comparison: Why IDC Matters

We simulated three different scenarios to demonstrate the robustness of infocentroid compared to classical statistics:

Metric Normal Data Symmetric Bimodal Data Data with Outliers
Classical Mean 49.74 49.97 (Falls in the empty valley) 51.49 (Dragged by outliers)
Classical SD 10.03 30.60 15.73 (Inflated)
IDC Center (ic_center) 49.74 49.91 50.04 (Robust)
IDC Dispersion (ic_dispersion) 9.25 30.65 2.38 (Accurate)

As demonstrated in the Data with Outliers column, 10 extreme values (around 200) completely skew the classical mean and standard deviation. However, IDC successfully ignores the noise and locks onto the true center (50) and true dispersion (sd = 5).

The Alpha Parameter

The alpha parameter controls the sharpness of the density focus. A higher alpha forces the metric to lock onto the most dominant peak (mode) of the distribution.

  • alpha = 1.35 (Default): Balances the density across peaks.
  • alpha >= 5: Locks onto the strongest peak. (e.g., In an asymmetric bimodal dataset, alpha = 5 shifts the center from 34.47 to 20.57, perfectly capturing the dominant cluster).

Installation

You can install the development version of infocentroid from GitHub:

# install.packages("devtools")
devtools::install_github("ahmetkutuk1/infocentroid")

Usage

Here is a quick example demonstrating how to use the core functions:

library(infocentroid)

# Create a dataset with an extreme outlier
set.seed(42)
data <- c(rnorm(99, mean = 50, sd = 5), 500) # 500 is an extreme outlier

# Classical metrics
mean(data) # Heavily skewed by the outlier
sd(data)   # Inflated

# Information-Dense Centroid metrics
ic_center(data)     # Robust center
ic_dispersion(data) # Robust dispersion

# Get a combined 0-1 information density score
ic_combined(data)

# Visualize the density and the IDC center
ic_plot(data)

Core Functions

  • ic_weights(): Calculates probability distributions and entropy weights using KDE or Histograms.
  • ic_center(): Computes the entropy-weighted center of the data.
  • ic_dispersion(): Computes the entropy-weighted dispersion.
  • ic_combined(): Combines sharpness and Signal-to-Noise Ratio (SNR) into a single score between 0 and 1.
  • ic_plot(): Generates a density plot highlighting the IDC.
  • ic_summary(): Prints all metrics to the console and automatically generates the plot.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("infocentroid")

0.1.0 by Ahmet Kutuk, 6 hours ago


https://github.com/ahmetkutuk1/infocentroid


Report a bug at https://github.com/ahmetkutuk1/infocentroid/issues


Browse source code at https://github.com/cran/infocentroid


Authors: Ahmet Kutuk [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, ggfx


See at CRAN