ifafgwc {naspaclust}R Documentation

Fuzzy Geographicaly Weighted Clustering with (Intelligent) Firefly Algorithm

Description

Fuzzy clustering with addition of spatial configuration of membership matrix with centroid optimization using (Intelligent) Firefly Algorithm.

Usage

ifafgwc(
  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",
  ei.distr = "normal",
  fa.same = 10,
  nfly = 10,
  ffly.no = 2,
  ffly.dist = "euclidean",
  ffly.order = 2,
  gamma = 1,
  ffly.beta = 1,
  ffly.alpha = 1,
  r.chaotic = 4,
  m.chaotic = 0.7,
  ind.levy = 1,
  skew.levy = 0,
  scale.levy = 1,
  ffly.alpha.type = 4
)

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.

ei.distr

distribution of random walk parameter. Can be defined as ei.distr in opt_param.

fa.same

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

nfly

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

ffly.no

The number of selected best fireflies for intelligent firefly algorithm. Can be defined as par.no= in opt_param. Default is 2

ffly.dist

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

ffly.order

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

gamma

distance scaling factor. Can be defined as gamma in opt_param. Default is 1.

ffly.beta

Attractiveness constant. Can be defined as beta in opt_param. Default is 1.

ffly.alpha

Randomisation constant. Can be defined as alpha= in opt_param.

r.chaotic

weight in logistic chaotic between [0,4]. Can be used when ei.distr='logchaotic'. Can be defined as chaos in opt_param. Default is 4.

m.chaotic

mapping parameter in kent chaotic between [0,1]. Can be used when ei.distr='kentchaotic'. Can be defined as map in opt_param. Default is 0.7.

ind.levy

Levy distribution index for random walk. Can be used when ei.distr='levy'. Can be defined as ind in opt_param. Default is 1.

skew.levy

Levy distribution skewness for random walk. Can be used when ei.distr='levy'. Can be defined as skew in opt_param. Default is 0.

scale.levy

Levy distribution scale for random walk. Can be used when ei.distr='levy'. Can be defined as sca in opt_param. Default is 1.

ffly.alpha.type

An integer. The type of ffly.alpha update. Can be selected from 1 to 5. Can be defined as update_type in opt_param. Default is 4.

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 Firefly Algorithm was developed by Yang (2009) and the technique is also upgraded by Fateen and Bonilla-Petriciolet (2013) by adding the intelligent phase (choosing the best firefly based on the intensity) in order to get a more optimal solution of a certain complex function. FGWC using IFA has been implemented previously by Nasution et al. (2020).

Value

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

References

Fateen SK, Bonilla-Petriciolet A (2013). “Intelligent Firefly Algorithm for Global Optimization.” Cuckoo Search and Firefly Algorithm: Theory and Applications, 516, 315–330.

Mason GA, Jacobson RD (2007). “Fuzzy Geographically Weighted Clustering.” In Proceedings of the 9th International Conference on Geocomputation, 1–7.

Nasution BI, Kurniawan R, Siagian TH, Fudholi A (2020). “Revisiting social vulnerability analysis in Indonesia: An optimized spatial fuzzy clustering approach.” International Journal of Disaster Risk Reduction, 51, 101801. doi: 10.1016/j.ijdrr.2020.101801, https://doi.org/10.1016/j.ijdrr.2020.101801.

Yang X (2009). “Firefly Algorithms for Multimodal Optimization.” In Stochastic Algorithms: Foundations and Applications, 169–178. Springer Berlin Heidelberg. doi: 10.1007/978-3-642-04944-6_14, https://doi.org/10.1007/978-3-642-04944-6_14.

See Also

fpafgwc gsafgwc

Examples

data('census2010')
data('census2010dist')
data('census2010pop')
# First way
res1 <- ifafgwc(census2010,census2010pop,census2010dist,3,2,'minkowski',4,nfly=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 IFA parameter
ifa_param <- c(vi.dist='uniform', ei.distr='logchaotic',
					fa.same=10, npar=15, par.no=3, par.dist='minkowski', 
           par.order=4, gamma=1, beta=1.5,
           alpha=1, chaos=4,update_type=4) 
##FGWC with IFA
res2 <- fgwc(census2010,census2010pop,census2010dist,'ifa',param_fgwc,ifa_param)

[Package naspaclust version 0.2.1 Index]