Learn more from fewer runsLesson 46 of 76 · 8 min

Pair opposite draws

Use antithetic variates and check whether their covariance is helpful.

Antithetic sampling pairs related draws with the same marginal distribution, often U and 1-U for a uniform input. Average the two function values to form one paired observation. If their covariance is negative, pairing can reduce variance.

For a monotone increasing function, high U produces a high value while 1-U produces a low one. The pair can balance. For other functions, both values can move together and the method may provide little benefit or even hurt.

Assess efficiency with the same number of function evaluations. The paired observations, not their individual members, are the independent units for the standard-error calculation. The example compares repeated estimates rather than applying an iid formula to correlated pair members.

Opposite inputs can offset noise
  1. Uniform draw
    U∼U(0,1)U\sim U(0,1)
  2. Paired opposite
    1−U1-U
  3. Average the pair
    12{eU+e1−U}\frac12\{e^U+e^{1-U}\}
Reference illustration. Both marginal inputs are uniform. The source compares equal function-evaluation budgets. Variance reduction depends on the covariance of the two function values, not on pairing alone.

If f(U) equals f(1-U), does the pair provide the usual negative-covariance benefit?

Write a prediction (optional)

Seeded teaching simulation

Select Run Python below with the code unchanged.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

Published example output

This result comes from the original Python. Your runs appear above. Build environment ↗

Exact expectation of exp(U): 1.718282
Ordinary SD across estimates: 0.037098
Antithetic SD across estimates: 0.006519
Equal function evaluations: 200

Read the first result

For this monotone integrand the pairing is useful. The result is conditional on the function, not a universal guarantee for opposite inputs.

Try an edit

Replace np.exp(u) + np.exp(1-u) with (u-.5)**2 + ((1-u)-.5)**2 and ordinary = np.exp(rng.random((repetitions, 2*pairs))).mean(axis=1) with ordinary = ((rng.random((repetitions, 2*pairs))-.5)**2).mean(axis=1) and print("Exact expectation of exp(U):", round(np.e-1, 6)) with print("Exact expectation of (U-.5)**2:", round(1/12, 6)). Select Run Python again. Compare Ordinary SD across estimates and Antithetic SD across estimates. What does pairing do when opposite draws now give the same outcome?

Back to the Python editor

Scope. Antithetic pairing can fail to reduce variance for non-monotone functions and does not repair biased input models.

Try a fresh case

What is the independent resampling unit in an antithetic estimator built from independent pairs?

Choose an answer
Need a hint?
Hint 1

Find what is independently generated.

Hint 2

Keep the two coupled evaluations together.

Your notes