Package 'GMC'

Title: Generalized Measure of Correlation (GMC)
Description: Provides tools to compute the Generalized Measure of Correlation (GMC), a dependence measure accounting for nonlinearity and asymmetry in the relationship between variables. Based on the method proposed by Zheng, Shi, and Zhang (2012) <doi:10.1080/01621459.2012.710509>.
Authors: Xuejing Ding [aut, cre], Zhengjun Zhang [aut]
Maintainer: Xuejing Ding <[email protected]>
License: GPL (>= 3)
Version: 0.1.2
Built: 2026-05-29 10:26:27 UTC
Source: https://github.com/cran/GMC

Help Index


Feature selection using GMC ranking

Description

Feature selection using GMC ranking

Usage

GMC_feature_ranking(X, Y, kernel = dnorm, sort = TRUE)

Arguments

X

A matrix or data.frame of predictors

Y

A numeric response vector

kernel

Kernel function (default = dnorm)

sort

Logical, whether to sort variables by GMC score

Value

A data.frame with variable names and GMC scores

Examples

# Generate sample data with multiple predictors
set.seed(123)
n <- 500
X1 <- rnorm(n)
X2 <- rnorm(n)
X3 <- rnorm(n)
Y <- 2 * X1 + X2^2 + rnorm(n, sd = 0.5)
X <- cbind(X1, X2, X3)

# Rank features by GMC
ranking <- GMC_feature_ranking(X, Y)
print(ranking)

Generalized Measure of Correlation: GMC(X | Y)

Description

Generalized Measure of Correlation: GMC(X | Y)

Usage

GMC_X_given_Y(X, Y, kernel = dnorm)

Arguments

X

Predictor variable

Y

Response variable

kernel

Kernel function (default = dnorm)

Value

GMC(X|Y) estimate

Examples

# Generate sample data with nonlinear relationship
set.seed(123)
n <- 1000
X <- rnorm(n)
Y <- X^2 + rnorm(n, sd = 0.5)

# Calculate GMC(X|Y)
gmc_result <- GMC_X_given_Y(X, Y)
print(gmc_result)

Generalized Measure of Correlation: GMC(Y | X)

Description

Generalized Measure of Correlation: GMC(Y | X)

Usage

GMC_Y_given_X(X, Y, kernel = dnorm)

Arguments

X

Predictor variable

Y

Response variable

kernel

Kernel function (default = dnorm)

Value

GMC(Y|X) estimate

Examples

# Generate sample data with linear relationship
set.seed(123)
n <- 1000
X <- rnorm(n)
Y <- 2 * X + rnorm(n, sd = 0.5)

# Calculate GMC(Y|X)
gmc_result <- GMC_Y_given_X(X, Y)
print(gmc_result)