All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.sandia.cognition.statistics.DataDistribution Maven / Gradle / Ivy

The newest version!
/*
 * File:                DataDistribution.java
 * Authors:             Kevin R. Dixon
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry
 * 
 * Copyright Apr 18, 2011, Sandia Corporation.
 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 * license for use of this work by or on behalf of the U.S. Government.
 * Export of this program may require a license from the United States
 * Government. See CopyrightHistory.txt for complete details.
 * 
 */

package gov.sandia.cognition.statistics;

import gov.sandia.cognition.math.matrix.InfiniteVector;
import gov.sandia.cognition.collection.ScalarMap;

/**
 * A distribution of data from which we can sample and perform Ring operations.
 * @param 
 *      The type of data stored at the indices, the hash keys.
 * @author  Justin Basilico
 * @author  Kevin R. Dixon
 * @since   3.3.1
 */
public interface DataDistribution
    extends DiscreteDistribution,
        EstimableDistribution>,
        ScalarMap
{

    @Override
    public DataDistribution clone();

    /**
     * Converts this data distribution to an infinite vector.
     *
     * @return
     *      A new {@code InfiniteVector} with values from this data
     *      distribution.
     */
    public InfiniteVector toInfiniteVector();

    /**
     * Replaces the entries in this data distribution with the entries in the
     * given infinite vector.
     *
     * @param   vector
     *      The infinite vector to use to populate this data distribution.
     */
    public void fromInfiniteVector(
        final InfiniteVector vector);

    /**
     * Computes the information-theoretic entropy of the vector in bits.
     *
     * @return
     *      Entropy in bits of the distribution.
     */
    public double getEntropy();

    /**
     * Gets the fraction of the counts represented by the given key.
     *
     * @param   key
     *      The key.
     * @return
     *      The fraction of the total count represented by the key, if it
     *      exists. Otherwise, 0.0.
     */
    public double getFraction(
        final DataType key);

    /**
     * Gets the natural logarithm of the fraction of the counts represented
     * by the given key.
     *
     * @param key
     * Key to consider
     * @return
     * Natural logarithm of the fraction of the counts represented by the key
     */
    public double getLogFraction(
        final DataType key);

    /**
     * Gets the total (sum) of the values in the distribution.
     *
     * @return
     *      The sum of the values in the distribution.
     */
    public double getTotal();

    @Override
    public DistributionEstimator> getEstimator();

    @Override
    public DataDistribution.PMF getProbabilityFunction();

    /**
     * Interface for the probability mass function (PMF) of a data distribution.
     *
     * @param 
     *      Type of data stored at the indices, the hash keys.
     */
    public static interface PMF
        extends DataDistribution,
        ProbabilityMassFunction
    {
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy