SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.random.variancereduction

Class AntitheticVariates

• java.lang.Object
• com.numericalmethod.suanshu.stats.random.variancereduction.AntitheticVariates
• All Implemented Interfaces:
MeanEstimator

public class AntitheticVariates
extends Object
implements MeanEstimator
The antithetic variates technique consists, for every sample path obtained, in taking its antithetic path - that is given a path $$\varepsilon_1,\dots,\varepsilon_M$$ to also take, for example, $$-\varepsilon_1,\dots,-\varepsilon_M$$ or $$1-\varepsilon_1,\dots,1-\varepsilon_M$$. The advantage of this technique is twofold: it reduces the number of normal samples to be taken to generate N paths, and it reduces the variance of the sample paths, improving the accuracy.
• Field Summary

Fields
Modifier and Type Field and Description
static UnivariateRealFunction INVERSE
static UnivariateRealFunction REFLECTION
• Constructor Summary

Constructors
Constructor and Description
AntitheticVariates(UnivariateRealFunction f, RandomNumberGenerator X1)
Estimate $$E(f(X_1))$$ and use INVERSE as the default antithetic path.
AntitheticVariates(UnivariateRealFunction f, RandomNumberGenerator X1, UnivariateRealFunction X2)
Estimate $$E(f(X_1))$$, where f is a function of a random variable.
• Method Summary

All Methods
Modifier and Type Method and Description
double cov()
Estimator estimate(int n)
Gets an estimator.
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Field Detail

• INVERSE

public static final UnivariateRealFunction INVERSE
• REFLECTION

public static final UnivariateRealFunction REFLECTION
• Constructor Detail

• AntitheticVariates

public AntitheticVariates(UnivariateRealFunction f,
RandomNumberGenerator X1,
UnivariateRealFunction X2)
Estimate $$E(f(X_1))$$, where f is a function of a random variable.
Parameters:
f - the random function to evaluate the expectation of
X1 - a random number generator
X2 - the antithetic function, given X
• AntitheticVariates

public AntitheticVariates(UnivariateRealFunction f,
RandomNumberGenerator X1)
Estimate $$E(f(X_1))$$ and use INVERSE as the default antithetic path.
Parameters:
f - the random function to evaluate the expectation of
X1 - a random number generator
• Method Detail

• cov

public double cov()
• estimate

public Estimator estimate(int n)
Description copied from interface: MeanEstimator
Gets an estimator.
Specified by:
estimate in interface MeanEstimator
Parameters:
n - the number of samples to draw for the estimation
Returns:
an estimator