001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.commons.math4.legacy.stat.ranking;
019
020/**
021 * Strategies for handling NaN values in rank transformations.
022 * <ul>
023 * <li>MINIMAL - NaNs are treated as minimal in the ordering, equivalent to
024 * (that is, tied with) <code>Double.NEGATIVE_INFINITY</code>.</li>
025 * <li>MAXIMAL - NaNs are treated as maximal in the ordering, equivalent to
026 * <code>Double.POSITIVE_INFINITY</code></li>
027 * <li>REMOVED - NaNs are removed before the rank transform is applied</li>
028 * <li>FIXED - NaNs are left "in place," that is the rank transformation is
029 * applied to the other elements in the input array, but the NaN elements
030 * are returned unchanged.</li>
031 * <li>FAILED - If any NaN is encountered in the input array, an appropriate
032 * exception is thrown</li>
033 * </ul>
034 *
035 * @since 2.0
036 */
037public enum NaNStrategy {
038
039    /** NaNs are considered minimal in the ordering. */
040    MINIMAL,
041
042    /** NaNs are considered maximal in the ordering. */
043    MAXIMAL,
044
045    /** NaNs are removed before computing ranks. */
046    REMOVED,
047
048    /** NaNs are left in place. */
049    FIXED,
050
051    /** NaNs result in an exception.
052     * @since 3.1
053     */
054    FAILED
055}