gov.sandia.cognition.statistics.montecarlo
Class UnivariateMonteCarloIntegrator

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.montecarlo.UnivariateMonteCarloIntegrator
All Implemented Interfaces:
MonteCarloIntegrator<Double>, CloneableSerializable, Serializable, Cloneable

public class UnivariateMonteCarloIntegrator
extends AbstractCloneableSerializable
implements MonteCarloIntegrator<Double>

A Monte Carlo integrator for univariate (scalar) outputs.

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

Field Summary
static double DEFAULT_VARIANCE
          Default variance to add to the Gaussian, 0.0.
static UnivariateMonteCarloIntegrator INSTANCE
          Default instance because this class has no state.
 
Constructor Summary
UnivariateMonteCarloIntegrator()
          Creates a new instance of UnivariateMonteCarloIntegrator
 
Method Summary
 UnivariateGaussian.PDF getMean(Collection<? extends Double> samples)
          Computes the Monte Carlo distribution of the given samples.
 UnivariateGaussian.PDF getMean(List<? extends WeightedValue<? extends Double>> samples)
          Computes the Monte Carlo distribution of the given weighted samples.
<SampleType>
UnivariateGaussian.PDF
integrate(Collection<? extends SampleType> samples, Evaluator<? super SampleType,? extends Double> expectationFunction)
          Integrates the given function given samples from another function.
<SampleType>
UnivariateGaussian.PDF
integrate(List<? extends WeightedValue<? extends SampleType>> samples, Evaluator<? super SampleType,? extends Double> expectationFunction)
          Integrates the given function given weighted samples from another 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
 

Field Detail

DEFAULT_VARIANCE

public static final double DEFAULT_VARIANCE
Default variance to add to the Gaussian, 0.0.

See Also:
Constant Field Values

INSTANCE

public static final UnivariateMonteCarloIntegrator INSTANCE
Default instance because this class has no state.

Constructor Detail

UnivariateMonteCarloIntegrator

public UnivariateMonteCarloIntegrator()
Creates a new instance of UnivariateMonteCarloIntegrator

Method Detail

integrate

public <SampleType> UnivariateGaussian.PDF integrate(Collection<? extends SampleType> samples,
                                                     Evaluator<? super SampleType,? extends Double> expectationFunction)
Description copied from interface: MonteCarloIntegrator
Integrates the given function given samples from another function.

Specified by:
integrate in interface MonteCarloIntegrator<Double>
Type Parameters:
SampleType - Type of samples to consider.
Parameters:
samples - Samples from the underlying distribution.
expectationFunction - Function for which to compute the expectation.
Returns:
Distribution of the integration.

integrate

public <SampleType> UnivariateGaussian.PDF integrate(List<? extends WeightedValue<? extends SampleType>> samples,
                                                     Evaluator<? super SampleType,? extends Double> expectationFunction)
Description copied from interface: MonteCarloIntegrator
Integrates the given function given weighted samples from another function.

Specified by:
integrate in interface MonteCarloIntegrator<Double>
Type Parameters:
SampleType - Type of samples to consider.
Parameters:
samples - Weighted samples from the underlying distribution.
expectationFunction - Function for which to compute the expectation.
Returns:
Distribution of the integration.

getMean

public UnivariateGaussian.PDF getMean(Collection<? extends Double> samples)
Description copied from interface: MonteCarloIntegrator
Computes the Monte Carlo distribution of the given samples.

Specified by:
getMean in interface MonteCarloIntegrator<Double>
Parameters:
samples - Samples to consider.
Returns:
Distribution describing the samples.

getMean

public UnivariateGaussian.PDF getMean(List<? extends WeightedValue<? extends Double>> samples)
Description copied from interface: MonteCarloIntegrator
Computes the Monte Carlo distribution of the given weighted samples.

Specified by:
getMean in interface MonteCarloIntegrator<Double>
Parameters:
samples - Weighted samples to consider.
Returns:
Distribution describing the samples.