## gov.sandia.cognition.statistics.montecarlo Interface MonteCarloIntegrator<OutputType>

Type Parameters:
`OutputType` - Type of output from the integrator.
All Superinterfaces:
Cloneable, CloneableSerializable, Serializable
All Known Implementing Classes:
MultivariateMonteCarloIntegrator, UnivariateMonteCarloIntegrator

```@PublicationReferences(references={@PublicationReference(author={"Christian P. Robert","George Casella"},title="Monte Carlo Statistical Methods, Second Edition",type=Book,year=2004,pages={83,106}),@PublicationReference(author="Wikipedia",title="Monte Carlo integration",type=WebPage,year=2010,url="http://en.wikipedia.org/wiki/Monte_Carlo_integration")})
public interface MonteCarloIntegrator<OutputType>extends CloneableSerializable```

Monte Carlo integration is a way of compute the integral of a function using samples from another. If, as is typical, the samples come from a probability distribution, then the result of Monte Carlo integration is the expectation of the function under the probability distribution. That is, Expectation == integral( g(x) * p(x) dx ) ~= (1/n) sum(g(x)), where x ~ p(x).

Since:
3.0
Author:
Kevin R. Dixon

Method Summary
` Distribution<? extends OutputType>` `getMean(Collection<? extends OutputType> samples)`
Computes the Monte Carlo distribution of the given samples.
` Distribution<? extends OutputType>` `getMean(List<? extends WeightedValue<? extends OutputType>> samples)`
Computes the Monte Carlo distribution of the given weighted samples.
``` <SampleType> Distribution<? extends OutputType> ``` ```integrate(Collection<? extends SampleType> samples, Evaluator<? super SampleType,? extends OutputType> expectationFunction)```
Integrates the given function given samples from another function.
``` <SampleType> Distribution<? extends OutputType> ``` ```integrate(List<? extends WeightedValue<? extends SampleType>> samples, Evaluator<? super SampleType,? extends OutputType> expectationFunction)```
Integrates the given function given weighted samples from another function.

Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
`clone`

Method Detail

### integrate

```<SampleType> Distribution<? extends OutputType> integrate(Collection<? extends SampleType> samples,
Evaluator<? super SampleType,? extends OutputType> expectationFunction)```
Integrates the given function given samples from another function.

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

```<SampleType> Distribution<? extends OutputType> integrate(List<? extends WeightedValue<? extends SampleType>> samples,
Evaluator<? super SampleType,? extends OutputType> expectationFunction)```
Integrates the given function given weighted samples from another function.

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

`Distribution<? extends OutputType> getMean(Collection<? extends OutputType> samples)`
Computes the Monte Carlo distribution of the given samples.

Parameters:
`samples` - Samples to consider.
Returns:
Distribution describing the samples.

### getMean

`Distribution<? extends OutputType> getMean(List<? extends WeightedValue<? extends OutputType>> samples)`
Computes the Monte Carlo distribution of the given weighted samples.

Parameters:
`samples` - Weighted samples to consider.
Returns:
Distribution describing the samples.