Package 'infocentroid'

Title: Information-Dense Centroid Metrics
Description: 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.
Authors: Ahmet Kutuk [aut, cre]
Maintainer: Ahmet Kutuk <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-11-08 20:47:13 UTC
Source: https://github.com/cran/infocentroid

Help Index


Information-Dense Centroid

Description

Calculates the entropy-weighted center of a numeric vector.

Usage

ic_center(x, method = c("hist", "kde"), alpha = NULL, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

...

Additional arguments passed to density().

Value

A single numeric value.

Examples

x <- c(rnorm(90, 0, 0.5), rnorm(10, 10, 2))
ic_center(x, method = "kde")

Information Density Score

Description

Combines sharpness (inverse entropy) and signal-to-noise ratio (SNR) into a single score between 0 and 1.

Usage

ic_combined(x, method = c("hist", "kde"), alpha = NULL, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

...

Additional arguments passed to density().

Value

A list containing the combined score and sub-components.


Information-Dense Dispersion

Description

Calculates the dispersion based on the same entropy-weighted distribution used in ic_center.

Usage

ic_dispersion(x, method = c("hist", "kde"), alpha = NULL, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

...

Additional arguments passed to density().

Value

A numeric value representing dispersion.


Plot Information-Dense Centroid

Description

Creates a futuristic, dark-themed plot comparing the classical mean with the IDC.

Usage

ic_plot(x, method = c("hist", "kde"), alpha = NULL, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

...

Additional arguments passed to density().

Value

A ggplot object.


Summary of Information-Dense Centroid

Description

Prints a comprehensive summary of classical and IC metrics, and optionally generates the plot.

Usage

ic_summary(x, method = c("hist", "kde"), alpha = NULL, plot = TRUE, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

plot

Logical. Whether to display the plot. Default is TRUE.

...

Additional arguments passed to density().

Value

Prints summary to console and returns the plot invisibly.


Internal Weights Calculation

Description

Computes the entropy-weighted distribution used by the IC metrics.

Usage

ic_weights(x, method = c("hist", "kde"), alpha = NULL, ...)

Arguments

x

A numeric vector.

method

Density estimation method.

alpha

Power parameter for weights.

...

Additional arguments passed to density().

Value

A list of values, weights, entropy, and alpha.