AI Glossary / Generative AI and language / Intermediate

Correlated sampling

Definition

Correlated sampling, in simulation-based comparison, deliberately links the randomness used to evaluate alternatives. A common form, called common random numbers, runs competing policies or system designs against corresponding random scenarios so their performance differences can be estimated more precisely.

What it means

Suppose two delivery policies are tested on different randomly generated demand days. One may look better partly because it received easier days. Testing both against matched demand scenarios helps distinguish policy differences from the luck of the draw.

The target is usually a difference between alternatives, not the variability of one alternative alone. Shared difficult scenarios may make both results worse together, creating positive correlation. When the two results are subtracted, part of that shared variation cancels.

“Correlated sampling” has other technical meanings, including coupling procedures in theoretical computer science and dependent samples in other statistical settings. This entry uses the common-random-number sense relevant to simulation and policy search. It should not be read as a general instruction to make every dataset or sample correlated.

How it works

Construct a set of random scenarios, such as arrival streams, demand shocks or initial conditions. Evaluate each alternative using corresponding scenarios while retaining the correct probability model for each alternative. Repeat with new independently generated scenario groups as required by the experiment.

If X and Y are the results for two alternatives, the variance of their difference is Var(X − Y) = Var(X) + Var(Y) − 2Cov(X,Y). Positive covariance reduces the variance of the difference relative to independent results with the same marginal variances. Negative covariance can make it worse.

Synchronization matters. Reusing a seed does not necessarily match meaningful events if the two programs consume random numbers in different orders. Separate streams or event-indexed draws can help align equivalent sources of uncertainty.

In reinforcement-learning policy search, a simulator can expose its random inputs so candidate policies are evaluated using repeatable scenarios. PEGASUS is a research example of this idea. The policies can still take different actions and reach different states; matching random inputs does not require forcing identical outcomes.

Three practical examples

  • A queueing simulation compares two staffing schedules using matched customer-arrival patterns.
  • A simulated inventory study compares reorder policies under corresponding demand scenarios.
  • A reinforcement-learning experiment compares candidate controllers using matched initial states and simulator random inputs.

Think of it this way

Think of comparing two umbrellas in the same shower rather than testing one in drizzle and the other in a downpour. Shared conditions can make their difference easier to interpret.

The analogy assumes the comparison preserves each umbrella's normal use. In a simulation, careless matching can distort a model's required randomness. Comparable conditions are useful only when the experiment still represents the intended systems.

Worked example

Seeing the variance reduction numerically

Assume two invented simulation outcomes each have variance 100. If they are generated independently, their covariance is zero, so the variance of X − Y is 100 + 100 = 200.

Now suppose a valid common-random-number design produces covariance 80 while preserving those marginal variances. The difference variance becomes 100 + 100 − 2 × 80 = 40. For 25 independent paired replications, the standard error of the mean difference is √(40 / 25), approximately 1.26. With independent alternatives it would be √(200 / 25), approximately 2.83.

This arithmetic assumes the stated variances and replication independence. It demonstrates a possible benefit, not a universal improvement factor. If the matching produced negative covariance, the difference could become noisier instead.

Illustrative case study

A fictional planning team at Rowan Dispatch compares two scheduling policies. Both use the same random seed, but one policy makes extra simulator calls when it reroutes a vehicle. Subsequent random draws no longer correspond to the same demand events.

The team separates demand randomness from policy-specific execution and checks that matching has the intended meaning. It analyses paired differences and reserves fresh scenarios for final evaluation after tuning.

The case illustrates two distinct concerns: technical alignment of random events and overfitting to a repeatedly reused scenario set. A reproducible experiment can still produce an overly optimistic estimate if the chosen policy has been tuned to its evaluation scenarios.

Common misconceptions and mistakes

  • The same seed guarantees a valid matched comparison. Random-number consumption and event meaning also matter.
  • Correlation always improves precision. For a difference, positive covariance helps under the stated comparison; negative covariance can hurt.
  • Every scenario must produce the same trajectory. Different actions can legitimately produce different states and rewards.
  • More precise differences prove the simulator is realistic. Variance reduction does not remove model bias.
  • Paired results should be analyzed as independent groups. The pairing is part of the experimental design and should be reflected in analysis.

Business use

The method can reduce simulation effort when a business wants to choose between operational policies. It is especially useful when background variability is large relative to the expected performance difference.

Record the scenario design, random-stream mapping, performance measure and analysis method. Report uncertainty for the difference rather than just separate average scores. Also evaluate the selected policy on fresh scenarios and check whether the simulator captures the conditions that matter in actual operation.

People also ask

Is this a way to remove uncertainty from the world?

No. It controls simulation comparisons; real operating variability remains.

Can it be used without reinforcement learning?

Yes. It is a general simulation comparison technique.

Does common randomness change an alternative's expected outcome?

A correctly designed coupling preserves each alternative's marginal simulation distribution. Distorting that distribution would undermine the comparison.

Check your understanding

Two outcomes each have variance 10, and their covariance under a paired design is 3. What is the variance of their difference?

Answer: 10 + 10 − 2 × 3 = 14. Under independence with the same marginal variances, it would be 20.

Related terms

  • Common random numbers
  • Covariance
  • Monte Carlo simulation
  • Policy search
  • variance reduction
  • paired comparison
  • PEGASUS
  • random seed

Learn next

Compare two simple simulated policies with independent draws and then with matched draws. Examine the variance of paired differences, not just each policy's variance. Document which random event each shared draw represents and keep a fresh scenario set for evaluating the policy chosen during development.

More in Generative AI and language

  • Constitutional AI - Constitutional AI is an approach to shaping AI behavior through an explicit set of written principles used in training and feedback.
  • Convenience sampling - Convenience sampling selects data or participants mainly because they are easy to obtain.
  • Conversational coding - Conversational coding is an iterative way of creating or changing software through dialogue with an AI system.
  • Cross-attention - Cross-attention is an attention mechanism in which queries come from one set of representations and keys and values come from another.
  • Diffusion model - A diffusion model is a generative model that learns to produce data through a process related to reversing progressive corruption.
  • Distillation - Distillation is training a student model using information supplied by a teacher model or ensemble.

Sources

Sources: Georgia Tech, Comparisons via Simulation, common random numbers: https://www2.isye.gatech.edu/~sman/courses/SISMID/Unit05a-ComparisonViaSimulation.pdf Simulation course slides, common random numbers and synchronisation: https://www3.cs.stonybrook.edu/~cse529/chap11.pdf Ng and Jordan, PEGASUS: A Policy Search Method for Large MDPs and POMDPs: https://ai.stanford.edu/~ang/papers/uai00-pegasus.pdf

Previous: Correct sampling Next: Correlated topic model

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer