View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * This is not the original file distributed by the Apache Software Foundation
20   * It has been modified by the Hipparchus project
21   */
22  
23  package org.hipparchus.stat.ranking;
24  
25  /**
26   * Strategies for handling tied values in rank transformations.
27   * <ul>
28   * <li>SEQUENTIAL - Ties are assigned ranks in order of occurrence in the original array,
29   * for example (1,3,4,3) is ranked as (1,2,4,3)</li>
30   * <li>MINIMUM - Tied values are assigned the minimum applicable rank, or the rank
31   * of the first occurrence. For example, (1,3,4,3) is ranked as (1,2,4,2)</li>
32   * <li>MAXIMUM - Tied values are assigned the maximum applicable rank, or the rank
33   * of the last occurrence. For example, (1,3,4,3) is ranked as (1,3,4,3)</li>
34   * <li>AVERAGE - Tied values are assigned the average of the applicable ranks.
35   * For example, (1,3,4,3) is ranked as (1,2.5,4,2.5)</li>
36   * <li>RANDOM - Tied values are assigned a random integer rank from among the
37   * applicable values. The assigned rank will always be an integer, (inclusively)
38   * between the values returned by the MINIMUM and MAXIMUM strategies.</li>
39   * </ul>
40   *
41   */
42  public enum TiesStrategy {
43  
44      /** Ties assigned sequential ranks in order of occurrence */
45      SEQUENTIAL,
46  
47      /** Ties get the minimum applicable rank */
48      MINIMUM,
49  
50      /** Ties get the maximum applicable rank */
51      MAXIMUM,
52  
53      /** Ties get the average of applicable ranks */
54      AVERAGE,
55  
56      /** Ties get a random integral value from among applicable ranks */
57      RANDOM
58  }