Documentation of 'jsat.linear.MatrixStatistics' Java class
MatrixStatistics
jsat.linear

Class MatrixStatistics



  • public class MatrixStatistics
    extends java.lang.Object
    This class provides methods useful for statistical operations that involve matrices and vectors.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static Vec covarianceDiag(Vec means, DataSet dataset)
      Computes the weighted diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
      static <V extends Vec>
      Vec
      covarianceDiag(Vec means, java.util.List<V> dataset)
      Computes the diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
      static void covarianceDiag(Vec means, Vec diag, DataSet dataset)
      Computes the weighted diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
      static <V extends Vec>
      void
      covarianceDiag(Vec means, Vec diag, java.util.List<V> dataset)
      Computes the diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
      static Matrix covarianceMatrix(Vec mean, DataSet dataSet)
      Computes the weighted covariance matrix of the data set
      static void covarianceMatrix(Vec mean, DataSet dataSet, Matrix covariance)
      Computes the weighted covariance matrix of the given data set.
      static void covarianceMatrix(Vec mean, DataSet dataSet, Matrix covariance, double sumOfWeights, double sumOfSquaredWeights)
      Computes the weighted covariance matrix of the given data set.
      static void covarianceMatrix(Vec mean, java.util.List<DataPoint> dataSet, Matrix covariance)
      Computes the weighted result for the covariance matrix of the given data set.
      static void covarianceMatrix(Vec mean, java.util.List<DataPoint> dataSet, Matrix covariance, double sumOfWeights, double sumOfSquaredWeights)
      Computes the weighted result for the covariance matrix of the given data set.
      static <V extends Vec>
      Matrix
      covarianceMatrix(Vec mean, java.util.List<V> dataSet) 
      static <V extends Vec>
      void
      covarianceMatrix(Vec mean, Matrix covariance, java.util.List<V> dataSet) 
      static <V extends Vec>
      void
      covarianceMatrix(Vec mean, Matrix covariance, java.util.List<V> dataSet, java.util.Collection<java.lang.Integer> subset) 
      static <V extends Vec>
      void
      FastMCD(Vec mean, Matrix cov, java.util.List<V> dataset, boolean parallel)
      This algorithm implements the FastMCD algorithm for robustly estimating the mean and covariance of a dataset.
      static Vec meanVector(DataSet dataSet)
      Computes the weighted mean of the given data set.
      static <V extends Vec>
      Vec
      meanVector(java.util.List<V> dataSet)
      Computes the mean of the given data set.
      static void meanVector(Vec mean, DataSet dataSet)
      Computes the weighted mean of the data set
      static <V extends Vec>
      void
      meanVector(Vec mean, java.util.List<V> dataSet)
      Computes the mean of the given data set.
      static <V extends Vec>
      void
      meanVector(Vec mean, java.util.List<V> dataSet, java.util.Collection<java.lang.Integer> subset)
      Computes the mean of the given data set.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • meanVector

        public static <V extends VecVec meanVector(java.util.List<V> dataSet)
        Computes the mean of the given data set.
        Type Parameters:
        V - the vector type
        Parameters:
        dataSet - the list of vectors to compute the mean of
        Returns:
        the mean of the vectors
      • meanVector

        public static Vec meanVector(DataSet dataSet)
        Computes the weighted mean of the given data set.
        Parameters:
        dataSet - the dataset to compute the mean from
        Returns:
        the mean of the numeric vectors in the data set
      • meanVector

        public static <V extends Vec> void meanVector(Vec mean,
                                                      java.util.List<V> dataSet)
        Computes the mean of the given data set.
        Parameters:
        mean - the zeroed out vector to store the mean in. Its contents will be altered
        dataSet - the set of data points to compute the mean from
      • meanVector

        public static <V extends Vec> void meanVector(Vec mean,
                                                      java.util.List<V> dataSet,
                                                      java.util.Collection<java.lang.Integer> subset)
        Computes the mean of the given data set.
        Type Parameters:
        V -
        Parameters:
        mean - the zeroed out vector to store the mean in. Its contents will be altered
        dataSet - the set of data points to compute the mean from
        subset - the indecies of the points in dataSet to take the mean of
      • meanVector

        public static void meanVector(Vec mean,
                                      DataSet dataSet)
        Computes the weighted mean of the data set
        Parameters:
        mean - the zeroed out vector to store the mean in. Its contents will be altered
        dataSet - the set of data points to compute the mean from
      • covarianceMatrix

        public static <V extends VecMatrix covarianceMatrix(Vec mean,
                                                              java.util.List<V> dataSet)
      • covarianceMatrix

        public static <V extends Vec> void covarianceMatrix(Vec mean,
                                                            Matrix covariance,
                                                            java.util.List<V> dataSet)
      • covarianceMatrix

        public static <V extends Vec> void covarianceMatrix(Vec mean,
                                                            Matrix covariance,
                                                            java.util.List<V> dataSet,
                                                            java.util.Collection<java.lang.Integer> subset)
      • covarianceMatrix

        public static void covarianceMatrix(Vec mean,
                                            java.util.List<DataPoint> dataSet,
                                            Matrix covariance)
        Computes the weighted result for the covariance matrix of the given data set. If all weights have the same value, the result will come out equivalent to covarianceMatrix(jsat.linear.Vec, java.util.List)
        Parameters:
        mean - the mean of the distribution.
        dataSet - the set of data points that contain vectors
        covariance - the zeroed matrix to store the result in. Its values will be altered.
      • covarianceMatrix

        public static void covarianceMatrix(Vec mean,
                                            java.util.List<DataPoint> dataSet,
                                            Matrix covariance,
                                            double sumOfWeights,
                                            double sumOfSquaredWeights)
        Computes the weighted result for the covariance matrix of the given data set. If all weights have the same value, the result will come out equivalent to covarianceMatrix(jsat.linear.Vec, java.util.List)
        Parameters:
        mean - the mean of the distribution.
        dataSet - the set of data points that contain vectors
        covariance - the zeroed matrix to store the result in. Its values will be altered.
        sumOfWeights - the sum of each weight in dataSet
        sumOfSquaredWeights - the sum of the squared weights in dataSet
      • covarianceMatrix

        public static Matrix covarianceMatrix(Vec mean,
                                              DataSet dataSet)
        Computes the weighted covariance matrix of the data set
        Parameters:
        mean - the mean of the data set
        dataSet - the dataset to compute the covariance of
        Returns:
        the covariance matrix of the data set
      • covarianceMatrix

        public static void covarianceMatrix(Vec mean,
                                            DataSet dataSet,
                                            Matrix covariance)
        Computes the weighted covariance matrix of the given data set.
        Parameters:
        mean - the mean of the data set
        dataSet - the dataset to compute the covariance of
        covariance - the zeroed out matrix to store the result into
      • covarianceMatrix

        public static void covarianceMatrix(Vec mean,
                                            DataSet dataSet,
                                            Matrix covariance,
                                            double sumOfWeights,
                                            double sumOfSquaredWeights)
        Computes the weighted covariance matrix of the given data set. Superfluous calculations are avoided by having the call provide information.
        Parameters:
        mean - the mean of the data set
        dataSet - the dataset to compute the covariance of
        covariance - the zeroed out matrix to store the result into
        sumOfWeights - the sum of the weights for each data point in the dataset
        sumOfSquaredWeights - the sum of the squared weights for each data point in the data set
      • covarianceDiag

        public static void covarianceDiag(Vec means,
                                          Vec diag,
                                          DataSet dataset)
        Computes the weighted diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
        Parameters:
        means - the already computed mean of the data set
        diag - the zeroed out vector to store the diagonal in. Its contents will be altered
        dataset - the data set to compute the covariance diagonal from
      • covarianceDiag

        public static Vec covarianceDiag(Vec means,
                                         DataSet dataset)
        Computes the weighted diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
        Parameters:
        means - the already computed mean of the data set
        dataset - the data set to compute the covariance diagonal from
        Returns:
        the diagonal of the covariance matrix for the given data
      • covarianceDiag

        public static <V extends Vec> void covarianceDiag(Vec means,
                                                          Vec diag,
                                                          java.util.List<V> dataset)
        Computes the diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
        Type Parameters:
        V - the type of the vector
        Parameters:
        means - the already computed mean of the data set
        diag - the zeroed out vector to store the diagonal in. Its contents will be altered
        dataset - the data set to compute the covariance diagonal from
      • covarianceDiag

        public static <V extends VecVec covarianceDiag(Vec means,
                                                         java.util.List<V> dataset)
        Computes the diagonal of the covariance matrix, which is the standard deviations of the columns of all values.
        Type Parameters:
        V -
        Parameters:
        means - the already computed mean of the data set
        dataset - the data set to compute the covariance diagonal from
        Returns:
        the diagonal of the covariance matrix for the given data
      • FastMCD

        public static <V extends Vec> void FastMCD(Vec mean,
                                                   Matrix cov,
                                                   java.util.List<V> dataset,
                                                   boolean parallel)
        This algorithm implements the FastMCD algorithm for robustly estimating the mean and covariance of a dataset. Computational complexity increases linearly with the sample size n, but cubically with the dimension size d.

        See: Rousseeuw, P. J., & Driessen, K. Van. (1999). A Fast Algorithm for the Minimum Covariance Determinant Estimator. Technometrics, 41(3), 212–223. http://doi.org/10.2307/1270566
        Type Parameters:
        V -
        Parameters:
        mean - the location to store the estimated mean, values will be overwritten
        cov - the location to store the estimated covariance, values will be overwritten
        dataset - the set of data points to estimate the mean and covariance of
        parallel - true if multiple cores should be used for estimation, false for single thread.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.