Class SphericalGaussianModel

  • All Implemented Interfaces:
    BetulaClusterModel, EMClusterModel<elki.data.NumberVector,​EMModel>

    public class SphericalGaussianModel
    extends java.lang.Object
    implements BetulaClusterModel
    Simple spherical Gaussian cluster (scaled identity matrixes).
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double logNorm
      Normalization factor.
      (package private) double logNormDet
      Normalization factor.
      (package private) double[] mean
      Mean vector.
      (package private) double[] nmea
      Temporary storage, to avoid reallocations.
      (package private) double priorvar
      Prior variance.
      private static double SINGULARITY_CHEAT
      Constant to avoid zero values.
      (package private) double variance
      Single variances for all dimensions.
      (package private) double weight
      Weight aggregation sum.
      (package private) double wsum
      Weight aggregation sum.
    • Field Detail

      • SINGULARITY_CHEAT

        private static final double SINGULARITY_CHEAT
        Constant to avoid zero values.
        See Also:
        Constant Field Values
      • mean

        double[] mean
        Mean vector.
      • variance

        double variance
        Single variances for all dimensions.
      • nmea

        double[] nmea
        Temporary storage, to avoid reallocations.
      • logNorm

        double logNorm
        Normalization factor.
      • logNormDet

        double logNormDet
        Normalization factor.
      • weight

        double weight
        Weight aggregation sum.
      • wsum

        double wsum
        Weight aggregation sum.
      • priorvar

        double priorvar
        Prior variance.
    • Constructor Detail

      • SphericalGaussianModel

        public SphericalGaussianModel​(double weight,
                                      double[] mean)
        Constructor.
        Parameters:
        weight - Cluster weight
        mean - Initial mean
      • SphericalGaussianModel

        public SphericalGaussianModel​(double weight,
                                      double[] mean,
                                      double var)
        Constructor.
        Parameters:
        weight - Cluster weight
        mean - Initial mean
        var - Initial variance
    • Method Detail

      • updateE

        public void updateE​(elki.data.NumberVector vec,
                            double wei)
        Description copied from interface: EMClusterModel
        Process one data point in the E step
        Specified by:
        updateE in interface EMClusterModel<elki.data.NumberVector,​EMModel>
        Parameters:
        vec - Vector to process
        wei - Weight of point ("responsibility" of the cluster)
      • finalizeEStep

        public void finalizeEStep​(double weight,
                                  double prior)
        Description copied from interface: EMClusterModel
        Finalize the E step.
        Specified by:
        finalizeEStep in interface EMClusterModel<elki.data.NumberVector,​EMModel>
        Parameters:
        weight - weight of the cluster
        prior - MAP prior (0 for MLE)
      • mahalanobisDistance

        public double mahalanobisDistance​(double[] vec)
        Compute the Mahalanobis distance from the centroid for a given vector.
        Parameters:
        vec - Vector
        Returns:
        Mahalanobis distance
      • mahalanobisDistance

        public double mahalanobisDistance​(elki.data.NumberVector vec)
        Compute the Mahalanobis distance from the centroid for a given vector.
        Parameters:
        vec - Vector
        Returns:
        Mahalanobis distance
      • estimateLogDensity

        public double estimateLogDensity​(elki.data.NumberVector vec)
        Description copied from interface: EMClusterModel
        Estimate the log likelihood of a vector.
        Specified by:
        estimateLogDensity in interface EMClusterModel<elki.data.NumberVector,​EMModel>
        Parameters:
        vec - Vector
        Returns:
        log likelihood.
      • getWeight

        public double getWeight()
        Description copied from interface: EMClusterModel
        Get the cluster weight.
        Specified by:
        getWeight in interface EMClusterModel<elki.data.NumberVector,​EMModel>
        Returns:
        Cluster weight
      • setWeight

        public void setWeight​(double weight)
        Description copied from interface: EMClusterModel
        Set the cluster weight.
        Specified by:
        setWeight in interface EMClusterModel<elki.data.NumberVector,​EMModel>
        Parameters:
        weight - Cluster weight
      • updateE

        public void updateE​(ClusterFeature cf,
                            double wei)
        Description copied from interface: BetulaClusterModel
        Process one clustering feature in the E step.
        Specified by:
        updateE in interface BetulaClusterModel
        Parameters:
        cf - Clustering feature to process.
        wei - weight of the clustering feature.