statistics
Class ParallelEM

java.lang.Object
  extended by statistics.ParallelEM

public final class ParallelEM
extends java.lang.Object

A parallel implementation of the EM algorithm. Uses an initial mixture and a ChunkedDataSet to update the parameters.

Author:
sikoried

Field Summary
 MixtureDensity current
          current estimate
 int ni
          number of iterations performed by this instance
 MixtureDensity previous
          previous estimate
 
Constructor Summary
ParallelEM(MixtureDensity initial, ChunkedDataSet data, int numThreads)
          Generate a new Estimator for parallel EM iterations.
 
Method Summary
 void iterate()
          Perform one EM iteration
 void iterate(int iterations)
          Perform a number of EM iterations
 void setChunkedDataSet(ChunkedDataSet data)
          Set the data set to work on
 void setNumberOfThreads(int num)
          Set the number of threads for the next iteration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

public MixtureDensity current
current estimate


ni

public int ni
number of iterations performed by this instance


previous

public MixtureDensity previous
previous estimate

Constructor Detail

ParallelEM

public ParallelEM(MixtureDensity initial,
                  ChunkedDataSet data,
                  int numThreads)
           throws java.io.IOException
Generate a new Estimator for parallel EM iterations.

Parameters:
initial - Initial mixture to start from (DATA IS MODIFIED)
data - data set to use
numThreads - number of threads (= CPUs)
Throws:
java.io.IOException
Method Detail

iterate

public void iterate()
             throws java.io.IOException,
                    java.lang.InterruptedException
Perform one EM iteration

Throws:
java.io.IOException
java.lang.InterruptedException

iterate

public void iterate(int iterations)
             throws java.io.IOException,
                    java.lang.InterruptedException
Perform a number of EM iterations

Parameters:
iterations -
Throws:
java.io.IOException
java.lang.InterruptedException

setChunkedDataSet

public void setChunkedDataSet(ChunkedDataSet data)
Set the data set to work on


setNumberOfThreads

public void setNumberOfThreads(int num)
Set the number of threads for the next iteration