Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

riso.distributions
Class MixGaussians  view MixGaussians download MixGaussians.java

java.lang.Object
  extended byriso.distributions.AbstractDistribution
      extended byriso.distributions.Mixture
          extended byriso.distributions.MixGaussians
All Implemented Interfaces:
ConditionalDistribution, Distribution, java.io.Serializable

public class MixGaussians
extends Mixture

This class represents an additive mixture of Gaussian densities. There is little added functionality; the main thing is the name guarantees that all mixture components are Gaussian.

The descriptive data which can be changed without causing the interface functions to break down is public. The other data is protected. Included in the public data are the regularization parameters.


Field Summary
 
Fields inherited from class riso.distributions.Mixture
component_niter_max, component_stopping_criterion, components, gamma, mix_proportions, ncomponents, ndims, NITER_MAX, STOPPING_CRITERION
 
Fields inherited from class riso.distributions.AbstractDistribution
associated_variable
 
Constructor Summary
MixGaussians()
          Constructs an empty Gaussian mixture.
MixGaussians(Gaussian p)
          This constructs a 1-component mixture from a Gaussian.
MixGaussians(int ndimensions, int ncomponents)
          Constructs a new Gaussian mixture with the specified number of dimensions and components.
 
Method Summary
(package private) static void compute_one_product(MixGaussians[] mixtures, MixGaussians product, int[] k, int[] l)
           
static MixGaussians convert_mixture(Mixture mix)
          Converts a Mixture consisting entirely of Gaussian into a MixGaussian.
 MixGaussians initial_mix(double[] support)
          Just returns a clone of this Gaussian mixture.
static MixGaussians mixture_product(MixGaussians[] mixtures)
          Computes a Gaussian mixture from the product of a set of Gaussian mixtures.
 void pretty_input(riso.general.SmarterTokenizer st)
          Read a description of this density model from an input stream.
(package private) static void product_inner_loop(MixGaussians[] mixtures, MixGaussians product, int[] k, int[] l, int m)
           
 void reduce_mixture(int max_ncomponents, double KL_epsilon)
          Trims down the number of components in this mixture by removing some and modifying the parameters of others.
 
Methods inherited from class riso.distributions.Mixture
cdf, clone, expected_value, flatten, format_string, ncomponents, ndimensions, p, random, remove_components, responsibility, sqrt_variance, update
 
Methods inherited from class riso.distributions.AbstractDistribution
effective_support, get_density, get_nstates, log_p, log_prior, ndimensions_child, ndimensions_parent, p, parse_string, pretty_output, random, set_variable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MixGaussians

public MixGaussians()
Constructs an empty Gaussian mixture.


MixGaussians

public MixGaussians(int ndimensions,
                    int ncomponents)
Constructs a new Gaussian mixture with the specified number of dimensions and components. Components can be set up one by one since Mixture.components is public. This constructor allocates the arrays to which member variables refer, and fills them with neutral values; the components array is filled with new Gaussian instances with zero mean and unit variance (in the specified number of dimensions).


MixGaussians

public MixGaussians(Gaussian p)
This constructs a 1-component mixture from a Gaussian. The p reference is COPIED, not cloned.

Method Detail

pretty_input

public void pretty_input(riso.general.SmarterTokenizer st)
                  throws java.io.IOException
Read a description of this density model from an input stream. This is intended for input from a human-readable source; this is different from object serialization.

Overrides:
pretty_input in class Mixture

reduce_mixture

public void reduce_mixture(int max_ncomponents,
                           double KL_epsilon)
Trims down the number of components in this mixture by removing some and modifying the parameters of others.


mixture_product

public static MixGaussians mixture_product(MixGaussians[] mixtures)
Computes a Gaussian mixture from the product of a set of Gaussian mixtures. Note that this is NOT THE SAME as computing a mixture for the product of variables with mixture densities.


product_inner_loop

static void product_inner_loop(MixGaussians[] mixtures,
                               MixGaussians product,
                               int[] k,
                               int[] l,
                               int m)

compute_one_product

static void compute_one_product(MixGaussians[] mixtures,
                                MixGaussians product,
                                int[] k,
                                int[] l)

initial_mix

public MixGaussians initial_mix(double[] support)
Just returns a clone of this Gaussian mixture.

Specified by:
initial_mix in interface Distribution
Overrides:
initial_mix in class Mixture

convert_mixture

public static MixGaussians convert_mixture(Mixture mix)
                                    throws java.lang.IllegalArgumentException
Converts a Mixture consisting entirely of Gaussian into a MixGaussian.