Class ClusterAnalyzer


  • public class ClusterAnalyzer
    extends Object
    This class counts clusters of exceedances based on observations above a given threshold, and the discontinuity of exceedances can be tolerated by an interval length r.

    The clusters of exceedances are identified as follows:

    1. The first exceedance of the threshold initiates the first cluster.
    2. The first cluster then remains active until either r consecutive values fall below (or are equal to) the threshold,
    3. The next exceedance of the threshold (if it exists) then initiates the second cluster, and so on.

    Average cluster size is the total number of exceedances divided by the total number of clusters (i.e., the cluster size of a cluster is defined as the number of exceedances within a cluster).

    The R equivalent function is evd::clusters.

    • Constructor Detail

      • ClusterAnalyzer

        public ClusterAnalyzer​(double threshold)
        Create an instance with the given threshold value and default interval length value of 1.
        Parameters:
        threshold - the threshold value
      • ClusterAnalyzer

        public ClusterAnalyzer​(double threshold,
                               int intervalLength)
        Create an instance with the given threshold and clustering interval length.
        Parameters:
        threshold - the threshold value
        intervalLength - the clustering interval length r
    • Method Detail

      • getThreshold

        public double getThreshold()
        Get the threshold for exceedance.
        Returns:
        the threshold
      • getIntervalLength

        public int getIntervalLength()
        Get the clustering interval length.
        Returns:
        the interval length
      • getClusters

        public Clusters getClusters​(double[] observations)
        Count clusters from the given observations.
        Parameters:
        observations - the observation to be analyzed
        Returns:
        the clusters