Class CommonRandomNumbers

    • Constructor Detail

      • CommonRandomNumbers

        public CommonRandomNumbers​(UnivariateRealFunction f,
                                   UnivariateRealFunction g,
                                   RandomLongGenerator X1,
                                   UnivariateRealFunction X2)
        Estimates \(E(f(X_1) - g(X_2))\), where f and g are functions of uniform random variables.
        Parameters:
        f - the first system
        g - the second system
        X1 - a uniform random number generator
        X2 - a common number generator; this scheme works only if \(Cov(f(X_1),g(X_2)) > 0\)
      • CommonRandomNumbers

        public CommonRandomNumbers​(UnivariateRealFunction f,
                                   UnivariateRealFunction g,
                                   RandomLongGenerator X1)
        Estimates \(E(f(X_1) - g(X_2))\), where f and g are functions of uniform random variables. We set X2 = X1.
        Parameters:
        f - the first system
        g - the second system
        X1 - a uniform random number generator
      • CommonRandomNumbers

        public CommonRandomNumbers​(UnivariateRealFunction f,
                                   UnivariateRealFunction g)
        Estimate \(E(f(X_1) - g(X_2))\), where f and g are functions of uniform random variables. We set X2 = X1.
        Parameters:
        f - the first system
        g - the second system
    • Method Detail

      • cov

        public double cov()
        Gets the covariance between f and g. The more negative it is, the small the variance.
        Returns:
        the covariance between f and g
      • 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