Create an empty (square) grid equipped with topology.

initGrid(
  dimension = c(5, 5),
  topo = c("square", "hexagonal"),
  dist.type = c("euclidean", "maximum", "manhattan", "canberra", "minkowski", "letremy")
)

Arguments

dimension

a 2-dimensional vector giving the dimensions (width, length) of the grid

topo

topology of the grid. Accept values "square" (Default) or "hexagonal".

dist.type

distance type that defines the topology of the grid (see 'Details'). Default to "euclidean"

Value

an object of class myGrid with the following entries:

  • coord 2-column matrix with x and y coordinates of the grid units

  • topo topology of the grid;

  • dim dimensions of the grid (width corresponds to x coordinates)

  • dist.type distance type that defines the topology of the grid.

Details

The units (neurons) of the grid are positionned at coordinates (1,1), (1,2), (1,3), ..., (2,1), (2,2), ..., for the square topology. The topology of the map is defined by a distance based on those coordinates, that can be one of "euclidean", "maximum", "manhattan", "canberra", "minkowski", "letremy", where the first 5 ones correspond to distance methods implemented in dist and "letremy" is the distance of the original implementation by Patrick Letrémy that switches between "maximum" and "euclidean" during the training.

References

Letrémy P. (2005) Programmes basés sur l'algorithme de Kohonen et dédiés à l'analyse des données. SAS/IML programs for 'korresp'.

See also

plot.myGrid for plotting the grid

Author

Élise Maigné elise.maigne@inrae.fr
Madalina Olteanu olteanu@ceremade.dauphine.fr
Nathalie Vialaneix nathalie.vialaneix@inrae.fr

Examples

initGrid()
#> 
#>       Self-Organizing Map structure
#> 
#>         Features   :
#>            topology     :  square 
#>            x dimension  :  5 
#>            y dimension  :  5 
#>            distance type:  euclidean 
#> 
initGrid(dimension=c(5, 7), dist.type = "maximum")
#> 
#>       Self-Organizing Map structure
#> 
#>         Features   :
#>            topology     :  square 
#>            x dimension  :  5 
#>            y dimension  :  7 
#>            distance type:  maximum 
#>