OptimStride: Compute a Series of Partitions/Clusterings

Description Usage Arguments Details Value Methods Author(s) References See Also Examples

Description

Compute a series of clusterings (strides) by different methods and quantify their quality using a Fisher test.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
OptimStride(x, k, ft.threshold = 1e-3, alternative = "greater",
            method = c("ward", "flexible", "pam", "kmeans", "wards",
                       "fanny", "FCM", "KM", "optpart"), fast = FALSE, ...)

## S4 method for signature 'VegsoupOptimstride'
method(x, ...)

## S4 method for signature 'VegsoupOptimstride'
stride(x, method, ...)

## S4 method for signature 'VegsoupOptimstride'
threshold(x, ...)

## S4 method for signature 'VegsoupOptimstride'
optimclass1(x, ...)

## S4 method for signature 'VegsoupOptimstride'
optimclass2(x, threshold = 2, ...)

## S4 method for signature 'VegsoupOptimstride'
getK(x)

## S4 method for signature 'VegsoupOptimstride'
peaks(x, ...)

## S4 method for signature 'VegsoupOptimstride'
which.max(x)

Arguments

x

for OptimStride a VegsoupPartition object, otherwise a VegsoupOptimstride object

k

maximum number of cluster to compute (seq(1:k))

ft.threshold

threshold value of Fisher test, defaults to a not very strict value of 1e-03.

alternative

alternative indicates the alternative hypothesis of the Fisher exact test and must be one of "two.sided", "greater" or "less" (see FisherTest and fisher.test).

threshold

threshold value for OptimClass2. See ‘Details’

method

any method supported by VegsoupPartition. For OptimStride if method is missing, "ward", "flexible", "pam", "kmeans", "wards", "fanny", "FCM", and "KM" are computed. Computationally expensive methods, such as "isopam" and "optpart" are omitted to reduce run duration.

fast

accelerate computations using package parallel. If FALSE a progress bar is printed. Depending on the dimension of the community matrix and the value of k, computations may consume a serious amount of time. If the host system provides 4 or more cores, settingfast = TRUE will significantly reduce run time.

...

additional arguments passed to VegsoupPartition, otherwise not used.

Details

The implementation follows the method of Tichy et al. (2010) and uses a Fisher test (FisherTest) to identify the number of ‘faithful’ species. This sensitivity of this statistic can be controlled by setting a threshold value. Per default this value (argument ft.threshold) is set to it's lowest meaningful bound 1e-3.

Partitioning/clustering methods, type of distance matrix and standardization are taken from the input object. Generic methods for 'VegsoupOptimstride' are detailed in the ‘Methods’ section.

Value

Optimstride

VegsoupOptimstride object

method

character. The computed methods.

stride

list. A list with length equal to length(method(x)). Each nested list gives the number of significant indicator species (faithful species) for each partition for a particular value of k.

optimclass1, optimclass2

matrix with dimnames. Rows are methods and columns are the respective values of k.

peaks

peaks of the curve.

Methods

method

signature(obj = "VegsoupOptimstride") : retrieves the names of the computed method(s). These are the method arguments as accepted by VegsoupPartition.

stride

signature(obj = "VegsoupOptimstride") : returns the number of faithful species for each partition and number of k.

threshold

signature(obj = "VegsoupOptimstride") : retrieves the threshold values set for the Fisher test.

optimclass1, optimclass2

signature(obj = "VegsoupOptimstride") : returns a matrix with the counts of faithful species, those achieving ft.trshold.

getK

signature(obj = "VegsoupOptimstride") : the computed maximum value of k, the length of each stride.

peaks

signature(obj = "VegsoupOptimstride") : the peaks along the stride.

which.max

signature(obj = "VegsoupOptimstride") : returns the number of k that coincides with the highest number of faithful species, per method.

Author(s)

Roland Kaiser

References

Tichy, L., Chytry, M., Hajek, M., Talbot, S.S., and Botta-Dukat, Z. (2010). Optimclass: Using species-to-cluster fidelity to determine the optimal partition in classification of ecological communities. Journal of Vegetation Science, 21(2):287-299.

See Also

VegsoupPartition, fidelity

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require(vegsoup)

# a dummy example using simulated data
x <- coenoflex(50, 100)

x <- OptimStride(x, k = 10, method = c("ward", "flexible", "pam"))

summary(x)

# get the computed clustering methods
method(x)

# the threshold of the Fisher test
threshold(x)

# matrix of results for OptimClass1
optimclass1(x)
boxplot(t(optimclass1(x)))

# the number of faithful species for each partition and method
# warning, method dispatch will break if package optpart is loaded
stride(x)
stride(x, method = "flexible") # for method flexible

# plot method for class VegsoupOptimstride
plot(x)
plot(x, method = "flexible")

# get k where the curve peaks
peaks(x)

# get k with the maximum number of faithful species
which.max(x)

vegsoup documentation built on Feb. 24, 2021, 3 a.m.