cordillera {stops} | R Documentation |
Calculates the OPTICS cordillera as in Rusch et al., 2015. Based on optics in dbscan package.
cordillera(confs, q = 1, minpts = 2, epsilon, rang = NULL, digits = 10, scale = TRUE, ...)
confs |
numeric matrix or data frame. This should probably be scaled to have mean=0 and variance=1. |
q |
the norm of the cordillera. Defaults to 1. |
minpts |
the minpts argument to elki. Defaults to 2. |
epsilon |
The epsilon parameter for OPTICS. Defaults to 2 times the range of x. |
rang |
A range of values that makes up dmax (dmax=max-min). If used for comparions this should be supplied. If no value is supplied, it is NULL (default). Then dmax is taken from the data as the difference between the largest reachability and the smallest reachability. In the latter case the cordillera is a "goodness-of-clusteredness" given the data, in the former case it also takes into account that the gaps between certain points may be larger which stands for more structure. |
digits |
round the raw corrdilrra and the norm factor to these digits. Defaults to 10. |
scale |
Should the confs be scaled to mean 0 and sd 1? Defaults to TRUE |
... |
Additional arguments to be passed to optics |
A list with the elements
$raw... The raw cordillera
$norm... The normalization constant
$normfac... The normalization factor (the number of times that dmax is taken)
$dmax... The maximum distance used for maximum structure
$normed... The normed cordillera (raw/norm)
$optics... The optics object
It may happen that the (normed) cordillera cannot be calculated properly (e.g. division by zero, inifnite raw cordillera, q value to high etc.). A warning will be printed and the normed cordillera is either 0, 1 (if infinity is involved) or NA. In that case one needs to check one or more of the following reachability values returned from optics, minpts, eps, the raw cordillera, dmax or the normalization factor.
data(BankingCrisesDistances) res<-cmdscale(BankingCrisesDistances[,1:69]) cres<-cordillera(res$points) #goodness of clusteredness is 0.176 cres summary(cres) plot(cres)