

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object gov.sandia.cognition.util.AbstractCloneableSerializable gov.sandia.cognition.statistics.AbstractDistribution<DataType> gov.sandia.cognition.statistics.distribution.LinearMixtureModel<DataType,DistributionType>
DataType
 Type of data in this mixture modelDistributionType
 The type of the internal distributions inside the mixture.@PublicationReference(author="Wikipedia", title="Mixture Model", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Mixture_model") public abstract class LinearMixtureModel<DataType,DistributionType extends Distribution<DataType>>
A linear mixture of RandomVariables, with a prior probability distribution. The posterior pdf is: p(xthis) = \sum_{y\in this} p(xy,this)P(ythis), where p(xy,this) is the pdf of the underlying RandomVariable, and P(ythis) is the prior probability of RandomVariable y in this.
Field Summary  

protected ArrayList<? extends DistributionType> 
distributions
Underlying distributions from which we sample 
protected double[] 
priorWeights
Weights proportionate by which the distributions are sampled 
Constructor Summary  

LinearMixtureModel(Collection<? extends DistributionType> distributions)
Creates a new instance of LinearMixtureModel 

LinearMixtureModel(Collection<? extends DistributionType> distributions,
double[] priorWeights)
Creates a new instance of LinearMixtureModel 
Method Summary  

LinearMixtureModel<DataType,DistributionType> 
clone()
This makes public the clone method on the Object class and
removes the exception that it throws. 
int 
getDistributionCount()
Gets the number of distributions in the model 
ArrayList<? extends DistributionType> 
getDistributions()
Getter for distributions 
double[] 
getPriorWeights()
Getter for priorWeights 
double 
getPriorWeightSum()
Computes the sum of the prior weights 
DataType 
sample(Random random)
Draws a single random sample from the distribution. 
ArrayList<DataType> 
sample(Random random,
int numSamples)
Draws multiple random samples from the distribution. 
void 
setDistributions(ArrayList<? extends DistributionType> distributions)
Setter for distributions 
void 
setPriorWeights(double[] priorWeights)
Getter for priorWeights 
String 
toString()

Methods inherited from class java.lang.Object 

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Field Detail 

protected ArrayList<? extends DistributionType extends Distribution<DataType>> distributions
protected double[] priorWeights
Constructor Detail 

public LinearMixtureModel(Collection<? extends DistributionType> distributions)
distributions
 Underlying distributions from which we samplepublic LinearMixtureModel(Collection<? extends DistributionType> distributions, double[] priorWeights)
distributions
 Underlying distributions from which we samplepriorWeights
 Weights proportionate by which the distributions are sampledMethod Detail 

public LinearMixtureModel<DataType,DistributionType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public String toString()
toString
in class Object
public ArrayList<? extends DistributionType> getDistributions()
public void setDistributions(ArrayList<? extends DistributionType> distributions)
distributions
 Underlying distributions from which we samplepublic int getDistributionCount()
public DataType sample(Random random)
Distribution
sample
in interface Distribution<DataType>
sample
in class AbstractDistribution<DataType>
random
 Randomnumber generator to use in order to generate random numbers.
public ArrayList<DataType> sample(Random random, int numSamples)
Distribution
random
 Randomnumber generator to use in order to generate random numbers.numSamples
 Number of samples to draw from the distribution.
public double[] getPriorWeights()
public void setPriorWeights(double[] priorWeights)
priorWeights
 Weights proportionate by which the distributions are sampledpublic double getPriorWeightSum()


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 