GRA: Grey Relational Analysis(GRA)

Description Usage Arguments Examples

View source: R/GRA.R

Description

first function: grey relational degree, which is similar to orrelation coefficient, if you want to evaluate some unit, please transpose data frame before using this function. second funtion: grey clustering, like hierarchical clustering, see hclust.

Usage

1
2
GRA(df, referColNum = 1, distingCoeff = 0.5, cluster = FALSE,
  clusterMethod = "single")

Arguments

df

a data frame with standardized data which can aviod the effects of dimensions. Note: it must includes reference sequence.

referColNum

the number of reference sequence in df.

distingCoeff

distinguishing coefficient, the smaller the higher distinguish.

cluster

logical value, indicates whether to cluster, default is FALSE. Note: this algorithm clusters by column(most clustering method are by row) because it is base on grey relational degree algorithm(mode like correlation coefficient, not evaluating mode).

clusterMethod

method of cluster.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## generate data
refer = c(1,1,1,1)
liaoning = c(0.064, 0.082,0.978,0.423)
shandong = c(0.101,0.3,1,0.917)
jiangsu = c(0.114,0.14,0.943, 0.315)
zhejiang = c(0.102,0.147,0.934,0.395)
fujian = c(0.022,0.053,0.927,0.061)
guangdong = c(1,1,0.012,1)
economyCompare = data.frame(refer, liaoning, shandong, jiangsu, zhejiang, fujian, guangdong)
rownames(economyCompare) = c("indGV", "indVA", "profit", "incomeTax")
## Grey Relational Degree
greyRelDegree = GRA(economyCompare)
greyRelDegree
## Grey Clustering
GRA(economyCompare, cluster = T)

Nisus-Liu/GRA documentation built on May 3, 2019, 5:03 p.m.