001    /*
002     * Copyright (C) 2008-2010 by Holger Arndt
003     *
004     * This file is part of the Universal Java Matrix Package (UJMP).
005     * See the NOTICE file distributed with this work for additional
006     * information regarding copyright ownership and licensing.
007     *
008     * UJMP is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU Lesser General Public License as
010     * published by the Free Software Foundation; either version 2
011     * of the License, or (at your option) any later version.
012     *
013     * UJMP is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016     * GNU Lesser General Public License for more details.
017     *
018     * You should have received a copy of the GNU Lesser General Public
019     * License along with UJMP; if not, write to the
020     * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
021     * Boston, MA  02110-1301  USA
022     */
023    
024    package org.ujmp.core.doublematrix.calculation.general.missingvalues;
025    
026    import org.ujmp.core.Matrix;
027    import org.ujmp.core.calculation.Calculation.Ret;
028    import org.ujmp.core.doublematrix.calculation.general.missingvalues.Impute.ImputationMethod;
029    import org.ujmp.core.exceptions.MatrixException;
030    
031    public interface MissingValueDoubleCalculations {
032    
033            /**
034             * Adds a specified amount of missing values (Double.NaN) to the Matrix
035             * 
036             * @param returnType
037             *            Select whether a new or a linked Matrix is returned, or if the
038             *            operation is performed on the original Matrix
039             * @param dimension
040             *            The axis along which to calculate
041             * @param percentMissing
042             *            defines how many values are missing 0.0 to 1.0
043             * @return Matrix with missing values
044             * @throws MatrixException
045             */
046            public Matrix addMissing(Ret returnType, int dimension, double... percentMissing)
047                            throws MatrixException;
048    
049            /**
050             * Counts the missing values within the matrix, i.e. Infinity or NaN
051             * 
052             * @param returnType
053             *            Select whether a new or a linked Matrix is returned, or if the
054             *            operation is performed on the original Matrix
055             * @param dimension
056             *            The axis along which to calculate
057             * @return Matrix with counts of missing values
058             * @throws MatrixException
059             */
060            public Matrix countMissing(Ret returnType, int dimension) throws MatrixException;
061    
062            /**
063             * Replaces missing values with various methods
064             * 
065             * @param returnType
066             *            Select whether a new or a linked Matrix is returned, or if the
067             *            operation is performed on the original Matrix
068             * @param method
069             *            the imputation method to use
070             * @param parameters
071             *            specify a set of parameters if needed
072             * @return Matrix with missing values replaced
073             * @throws MatrixException
074             */
075            public Matrix impute(Ret returnType, ImputationMethod method, Object... parameters)
076                            throws MatrixException;
077    
078            public Matrix deleteColumnsWithMissingValues(Ret returnType) throws MatrixException;
079    
080            public Matrix deleteRowsWithMissingValues(Ret returnType, long threshold)
081                            throws MatrixException;
082    
083    }