gsafgwc {naspaclust}R Documentation

Fuzzy Geographicaly Weighted Clustering with Gravitational Search Algorithm

Description

Fuzzy clustering with addition of spatial configuration of membership matrix with centroid optimization using Gravitational Search Algorithm

Usage

gsafgwc(
  data,
  pop = NA,
  distmat = NA,
  ncluster = 2,
  m = 2,
  distance = "euclidean",
  order = 2,
  alpha = 0.7,
  a = 1,
  b = 1,
  error = 1e-05,
  max.iter = 100,
  randomN = 0,
  vi.dist = "uniform",
  npar = 10,
  par.no = 2,
  par.dist = "euclidean",
  par.order = 2,
  gsa.same = 10,
  G = 1,
  vmax = 0.7,
  new = F
)

Arguments

data

an object of data with d>1. Can be matrix or data.frame. If your data is univariate, bind it with 1 to get a 2 columns.

pop

an n*1 vector contains population.

distmat

an n*n distance matrix between regions.

ncluster

an integer. The number of clusters.

m

degree of fuzziness or fuzzifier. Default is 2.

distance

the distance metric between data and centroid, the default is euclidean, see cdist for details.

order

minkowski order. default is 2.

alpha

the old membership effect with [0,1], if alpha equals 1, it will be same as fuzzy C-Means, if 0, it equals to neighborhood effect.

a

spatial magnitude of distance. Default is 1.

b

spatial magnitude of population. Default is 1.

error

error tolerance. Default is 1e-5.

max.iter

maximum iteration. Default is 500.

randomN

random seed for initialisation (if uij or vi is NA). Default is 0.

vi.dist

a string of centroid population distribution between 'uniform' (default) and 'normal'. Can be defined as vi.dist= in opt_param.

npar

number of particle. Can be defined as npar= in opt_param. Default is 10.

par.no

The number of selected best particle. Can be defined as par.no= in opt_param. Default is 2

par.dist

The distance between particles. Can be defined as par.dist= in opt_param. Default is 'euclidean',

par.order

The minkowski order of the par.dist if par.dist='minkowski'. Can be defined as par.order= in opt_param. Default is 2

gsa.same

number of consecutive unchange to stop the iteration. Can be defined as same= in opt_param.

G

initial gravitatioal constant, Can be defined as G in opt_param. default is 1.

vmax

maximum velocity to be tolerated. Can be defined as vmax in opt_param. Default is 0.7

new

Boolean that represents whether to use the new algorithm by Li and Dong (2017). Can be defined as new in opt_param. Default is FALSE

Details

Fuzzy Geographically Weighted Clustering (FGWC) was developed by Mason and Jacobson (2007) by adding neighborhood effects and population to configure the membership matrix in Fuzzy C-Means. Furthermore, the Gravitational Search Algorithm was developed by Rashedi et al. (2009) and and the technique is also upgraded by Li and Dong (2017) in order to get a more optimal solution of a certain complex function. FGWC using GSA has been implemented previously by Pamungkas and Pramana (2019).

Value

an object of class 'fgwc'.
An 'fgwc' object contains as follows:

References

Li J, Dong N (2017). “Gravitational Search Algorithm with a New Technique.” In 2017 13th International Conference on Computational Intelligence and Security (CIS), 516–519. doi: 10.1109/CIS.2017.00120, https://doi.org/10.1109/CIS.2017.00120.

Pamungkas IH, Pramana S (2019). “Improvement Method of Fuzzy Geographically Weighted Clustering using Gravitational Search Algorithm.” Journal of Computer Science and Information, 11(1).

Rashedi E, Nezamabadi-pour H, Saryazdi S (2009). “GSA: A Gravitational Search Algorithm.” Information Sciences, 179(13).

See Also

fpafgwc gsafgwc

Examples

data('census2010')
data('census2010dist')
data('census2010pop')
# First way
res1 <- gsafgwc(census2010,census2010pop,census2010dist,3,2,'euclidean',4,npar=10)
# Second way
# initiate parameter
param_fgwc <- c(kind='v',ncluster=3,m=2,distance='minkowski',order=3,
               alpha=0.5,a=1.2,b=1.2,max.iter=1000,error=1e-6,randomN=10)
## tune the GSA parameter
gsa_param <- c(vi.dist='normal',npar=5,same=15,G=1,vmax=0.7,new=FALSE) 
##FGWC with GSA
res2 <- fgwc(census2010,census2010pop,census2010dist,'gsa',param_fgwc,gsa_param)

[Package naspaclust version 0.2.1 Index]