Class 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.
    See Also:
    • Constructor Detail

      • AntitheticVariates

        public AntitheticVariates​(UnivariateRealFunction f,
                                  RandomNumberGenerator X1,
                                  UnivariateRealFunction X2)
        Estimates \(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)
        Estimates \(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