variance-reduction

Implements importance sampling, antithetic variates, stratified sampling, and control variates for Monte Carlo simulation.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/travis-burmaster/agentbox --skill variance-reduction-travis-burmaster
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: variance-reduction
Source: https://github.com/travis-burmaster/agentbox/tree/main/examples/llm-proxy-gitagent/workspace/skills/variance-reduction
Command: npx skills add https://github.com/travis-burmaster/agentbox --skill variance-reduction-travis-burmaster

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy.

What problem does it solve? Crude Monte Carlo simulation is too slow and imprecise for rare-event estimation and tail-risk contracts, often requiring millions of samples to produce usable confidence intervals. This Skill applies variance reduction techniques that achieve 100-10,000x efficiency gains over naive sampling. ## Core Features & Use Cases - Importance Sampling for Rare Events: Tilts the sampling distribution to oversample extreme outcomes (e.g., market crashes), then corrects with likelihood ratios for unbiased estimates. - Antithetic Variates: Pairs each random draw Z with -Z to exploit symmetry in monotone payoffs, cutting variance at zero computational cost. - Stratified Sampling: Partitions the probability space into strata and samples within each for uniform coverage of the outcome distribution. - Control Variates: Uses closed-form Black-Scholes digital prices to correct stochastic volatility simulation estimates. - Use Case: Pricing a binary contract on a 20% S&P drop in one week where crude Monte Carlo at 100K samples yields zero hits; importance sampling produces a stable estimate with measurable standard error. ## Quick Start Ask the agent to estimate the probability of a 20% market crash in one week using importance sampling with 100,000 paths and compare it against crude Monte Carlo.

Frequently Asked Questions about variance-reduction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate rare event probabilities with Monte Carlo?

Use importance sampling: tilt the sampling distribution toward the rare region, simulate under the tilted measure, then correct each payoff with a likelihood ratio. This produces unbiased estimates with dramatically lower variance than crude Monte Carlo for extreme outcomes.

What is the difference between antithetic variates and stratified sampling?

Antithetic variates pair each draw Z with -Z to exploit payoff symmetry, giving roughly 50-75% variance reduction at zero cost. Stratified sampling partitions the probability space into strata and samples within each, ensuring uniform coverage of the distribution.

How do control variates reduce Monte Carlo variance?

Control variates subtract a correlated quantity with a known expected value from the estimator. Here, the closed-form Black-Scholes digital price corrects stochastic volatility simulation estimates, with the optimal coefficient beta estimated from the same simulated paths.

When should I use importance sampling instead of crude Monte Carlo?

Use importance sampling when the event of interest is rare, such as contracts trading below $0.05 or extreme market crashes, where crude Monte Carlo at 100K samples may produce zero hits. It can achieve 100-10,000x variance reduction in these regimes.

Can variance reduction techniques be combined in one simulation?

Yes. Antithetic variates can be applied inside each stratum of a stratified sampler, with a control variate correction on top. Stacking all three routinely achieves 100-500x variance reduction over crude Monte Carlo in production settings.