grey_analysis: Grey Relational Analysis Functions

grey_analysisR Documentation

Grey Relational Analysis Functions

Description

A collection of functions for performing grey relational analysis, including calculation of grey correlation degree and evaluation based on grey correlation. These functions are designed for decision-making and data analysis by measuring the relational degree between sequences.

Usage

gray_corr(ck, bj, rho = 0.5, w = NULL)

gray_corr_eval(A, w, rho = 0.5)

Arguments

ck

Numeric vector, the reference sequence for gray_corr.

bj

Numeric matrix or data.frame, the comparison sequences for gray_corr.

rho

Numeric scalar, the distinguishing coefficient (default = 0.5).

w

Numeric vector, weights for weighted correlation (default = equal weights).

A

Numeric matrix or data.frame, the decision matrix for gray_corr_eval.

Details

These functions implement grey relational analysis for evaluating relationships between sequences or decision alternatives:

  • gray_corr: Computes the grey correlation degree between a reference sequence (ck) and comparison sequences (bj) using the distinguishing coefficient (rho) and optional weights (w).

  • gray_corr_eval: Evaluates a decision matrix (A) by normalizing it, applying weights (w), computing grey correlation with the ideal sequence, and scaling results to 0, 100.

Value

  • gray_corr: Numeric vector, the grey correlation degree for each comparison sequence.

  • gray_corr_eval: Numeric vector, normalized evaluation scores in 0, 100.

Examples

# Grey correlation degree
ck = 1:3
bj = data.frame(x1 = c(1, 2, 4), x2 = c(2, 3, 5))
gray_corr(ck, bj, rho = 0.5)

# Grey correlation evaluation#'
w = c(0.4, 0.6)
gray_corr_eval(bj, w, rho = 0.5)


zhjx19/mathmodels documentation built on June 2, 2025, 12:18 a.m.