Documentation of 'jsat.distributions.multivariate.NormalM' Java class
NormalM
jsat.distributions.multivariate

Class NormalM

    • Constructor Detail

      • NormalM

        public NormalM(Vec mean,
                       Matrix covariance)
      • NormalM

        public NormalM()
    • Method Detail

      • setMeanCovariance

        public void setMeanCovariance(Vec mean,
                                      Matrix covariance)
        Sets the mean and covariance for this distribution. For an n dimensional distribution, mean should be of length n and covariance should be an n by n matrix. It is also a requirement that the matrix be symmetric positive definite.
        Parameters:
        mean - the mean for the distribution. A copy will be used.
        covariance - the covariance for this distribution. A copy will be used.
        Throws:
        java.lang.ArithmeticException - if the mean and covariance do not agree, or the covariance is not positive definite. An exception may not be throw for all bad matrices.
      • setCovariance

        public void setCovariance(Matrix covMatrix)
        Sets the covariance matrix for this matrix.
        Parameters:
        covMatrix - set the covariance matrix used for this distribution
        Throws:
        java.lang.ArithmeticException - if the covariance matrix is not square, does not agree with the mean, or is not positive definite. An exception may not be throw for all bad matrices.
      • logPdf

        public double logPdf(Vec x)
        Description copied from interface: MultivariateDistribution
        Computes the log of the probability density function. If the probability of the input is zero, the log of zero would be Double.NEGATIVE_INFINITY. Instead, -Double.MAX_VALUE is returned.
        Specified by:
        logPdf in interface MultivariateDistribution
        Overrides:
        logPdf in class MultivariateDistributionSkeleton
        Parameters:
        x - the vector the get the log probability of
        Returns:
        the log of the probability.
      • pdf

        public double pdf(Vec x)
        Description copied from interface: MultivariateDistribution
        Returns the probability of a given vector from this distribution. By definition, the probability will always be in the range [0, 1].
        Parameters:
        x - the vector the get the log probability of
        Returns:
        the probability
      • setUsingData

        public <V extends Vec> boolean setUsingData(java.util.List<V> dataSet,
                                                    boolean parallel)
        Description copied from interface: MultivariateDistribution
        Sets the parameters of the distribution to attempt to fit the given list of vectors. All vectors are assumed to have the same weight.
        Type Parameters:
        V - the vector type
        Parameters:
        dataSet - the list of data points
        parallel - true if the training should be done using multiple-cores, false for single threaded.
        Returns:
        true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
      • sample

        public java.util.List<Vec> sample(int count,
                                          java.util.Random rand)
        Description copied from interface: MultivariateDistribution
        Performs sampling on the current distribution.
        Parameters:
        count - the number of iid samples to draw
        rand - the source of randomness
        Returns:
        a list of sample vectors from this distribution

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.