gov.sandia.cognition.statistics.montecarlo
Class DirectSampler<DataType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.montecarlo.DirectSampler<DataType>
Type Parameters:
DataType - Type of data to sample.
All Implemented Interfaces:
MonteCarloSampler<DataType,DataType,ProbabilityFunction<DataType>>, CloneableSerializable, Serializable, Cloneable

public class DirectSampler<DataType>
extends AbstractCloneableSerializable
implements MonteCarloSampler<DataType,DataType,ProbabilityFunction<DataType>>

Sampler that generates samples directly from a target distribution.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
DirectSampler()
          Creates a new instance of DirectSampler
 
Method Summary
 ArrayList<? extends DataType> sample(ProbabilityFunction<DataType> targetFunction, Random random, int numSamples)
          Draws samples according to the distribution of the target function.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

DirectSampler

public DirectSampler()
Creates a new instance of DirectSampler

Method Detail

sample

public ArrayList<? extends DataType> sample(ProbabilityFunction<DataType> targetFunction,
                                            Random random,
                                            int numSamples)
Description copied from interface: MonteCarloSampler
Draws samples according to the distribution of the target function.

Specified by:
sample in interface MonteCarloSampler<DataType,DataType,ProbabilityFunction<DataType>>
Parameters:
targetFunction - Target function that we want to generate samples.
random - Random-number generator.
numSamples - Number of samples to generate.
Returns:
Samples