Package dev.nm.stat.evt.cluster
Class ClusterAnalyzer
- java.lang.Object
-
- dev.nm.stat.evt.cluster.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 lengthr
. The clusters of exceedances are identified as follows:- The first exceedance of the threshold initiates the first cluster.
- The first cluster then remains active until either
r
consecutive values fall below (or are equal to) the threshold, - The next exceedance of the threshold (if it exists) then initiates the second cluster, and so on.
evd::clusters
.
-
-
Constructor Summary
Constructors Constructor Description ClusterAnalyzer(double threshold)
Create an instance with the given threshold value and default interval length value of 1.ClusterAnalyzer(double threshold, int intervalLength)
Create an instance with the given threshold and clustering interval length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Clusters
getClusters(double[] observations)
Count clusters from the given observations.int
getIntervalLength()
Get the clustering interval length.double
getThreshold()
Get the threshold for exceedance.
-
-
-
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 valueintervalLength
- the clustering interval lengthr
-
-
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
-
-