GLOBAL KNOWLEDGE ARK

Mathematics · Article

Monte Carlo methods and sampling

Use Monte Carlo methods to estimate integrals, probabilities and sensitivities. Derive the error and work of direct sampling, variance reduction, Markov chain methods and multilevel estimates, then test which guarantees apply.

Back to Mathematics

After reading, you can

  • Write an integral or event probability as an expectation and derive the error statements for independent draws.
  • Build samplers from uniforms and compare direct, rejected, weighted and self-normalized samples under their support conditions.
  • Use covariance, conditioning and allocation to compare variance at a stated work budget.
  • Derive one-dimensional discrepancy bounds, random-shift variance, and the invariant laws of Metropolis and Hamiltonian proposals.
  • Derive uncertainty for dependent averages, unbiased particle normalizers, and multilevel work with rounding and finest-level cost.
  • Construct justified sensitivity estimators, randomized truncation and time-uniform certificates with an explicit total error budget.
01

What does a simulation estimate?

A simulation converts an integral or probability into a statistic of draws from a declared law. The first task is to choose the target and show that the statistic estimates it. We build the independent sample mean, its variance, its normal limit, and its bounded-observation error guarantee separately. The difference matters when estimating rare events. Zero observed hits still leave a range of plausible probabilities.

Changing the estimator can change the work by orders of magnitude. Inverse distributions, rejection and importance sampling change how observations are produced or weighted. Controls, antithetic pairs, common inputs, stratification and conditioning change variance through known structure. We derive which random shifts make quadrature unbiased, why Metropolis and Hamiltonian updates preserve a target, and how dependence changes the uncertainty of a chain average.

The advanced sections follow the same accounting into particle weights, multilevel corrections, stochastic sensitivities and randomized truncation. A single simulation may carry target-model discrepancy, numerical error, sampling error and an uncertain running cost. We track each through separate formulas in threshold probabilities, physical observables, biological transport and resource models. State the law, inputs and units so someone else can tell which conclusions depend on model assumptions.

02

An integral becomes a random observation

Let X have the declared probability law p on a measurable state space, and let Y=g(X) be a real observable with E_p|g(X)|<infinity. The target mu is the actual integral integral g(x)p(dx). A sampling representation is useful only if the experiment really produces that law: an observed list or a convenient proposal is not automatically a draw from p. For example, on a domain D with finite positive volume V, an exactly uniform point gives integral_D h(x) dx=V E[h(X)], so the observation for that unnormalized integral is Y=Vh(X). A zero-volume domain has zero Lebesgue integral for an integrable h and is handled directly rather than by a uniform density 1/V.

For independent copies Y_1,...,Y_n with n>=1, define barY_n=(1/n) sum_i Y_i. Integrability permits summing expectations, giving E barY_n=mu. If in addition E Y squared is finite, write sigma squared=E[(Y-mu) squared]. Expanding the centered square gives E[(barY_n-mu) squared]=(1/n squared) sum_(i,j) E[(Y_i-mu)(Y_j-mu)]. For i!=j independence and centering make the cross expectation zero; the n diagonal terms each equal sigma squared. Thus the estimator variance and mean-square error are exactly sigma squared/n. Integrability alone established the mean, not this finite variance.

For a vector observable G with finitely many components and finite second moments, define Sigma_(a,b)=E[(G_a-mu_a)(G_b-mu_b)]. The same expansion across independent sample indices gives Cov(barG_n)=Sigma/n. Different components measured on the same point may remain correlated; their off-diagonal covariances do not disappear just because different points are independent. For any fixed vector c, the scalar estimate c transpose barG has variance c transpose Sigma c/n, as direct expansion of its quadratic form also shows.

The standard deviation is sigma/sqrt(n), while increasing the sample count does not change the specified target law or any bias caused by sampling the wrong one. In the uniform-domain example the factor V multiplies the mean and its square multiplies the variance. An integral with units of observable times volume therefore has variance in the square of those units. Exact constant observations have sigma squared=0 and zero sampling error. Nonidentical or dependent observations require their actual covariances; neither an empirical appearance of randomness nor this calculation proves those assumptions. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf). An explicit target law and an integrable observable define the estimand. The exact covariance of the iid mean follows from zero cross-covariances and has squared output units. Owen provides the ordinary sampling variance and work benchmark.

03

Consistency from an actual maximum bound

Put Z_i=Y_i-mu and S_j=sum_(i=1)^j Z_i for independent identically distributed observations of finite variance sigma squared. The previous calculation gives E S_n squared=n sigma squared, and Chebyshev yields P(|S_n|/n>=epsilon)<=sigma squared/(n epsilon squared). This proves convergence in probability and in mean square. To obtain an almost-sure statement for every large n, rather than just a selected sequence of n, we also need a maximum bound for the centered partial sums.

For a threshold lambda>0, let A_j be the event that j is the first index at which |S_j|>=lambda, with j<=N. These events are disjoint and belong to the history of the first j observations. Independence of the remaining centered increments gives E[1_(A_j) S_N squared]=E[1_(A_j) S_j squared]+E[1_(A_j)(S_N-S_j) squared]>=lambda squared P(A_j); the cross term vanishes by conditioning on that history. Summing the disjoint events and bounding their restricted S_N-squared expectation by its unrestricted expectation proves P(max_(j<=N)|S_j|>=lambda)<=N sigma squared/lambda squared. No independent-increment assumption about a data-chosen stopping decision was inserted.

Take N=2^k and lambda=epsilon*2^k. The resulting probabilities are bounded by sigma squared/(epsilon squared*2^k), whose sum over k is finite. The elementary summable-event argument is that the probability of at least one such event with k>=K is at most the tail sum, which tends to zero. Hence only finitely many occur almost surely. Apply this argument simultaneously to epsilon=1/m for every positive integer m, using a countable intersection of probability-one events.

If 2^(k-1)<n<=2^k, then |S_n|/n<=2 max_(j<=2^k)|S_j|/2^k. The preceding event control makes its eventual upper bound at most 2/m for every m, so S_n/n tends to zero almost surely. Thus barY_n tends to mu both almost surely and in mean square under the stated finite-variance premise. The zero-variance case is direct because all centered observations vanish almost surely. A more general integrable strong law is not being claimed proved by this finite-second-moment argument; nor does convergence itself give a finite observed error bar. Related reading: [A maximum inequality with its integrability proof](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf). The lesson proves its own square-integrable independent-sum maximum bound and controls all indices between dyadic checkpoints. Durrett's maximal estimate supports the method and is neither the full iid law nor a substitute for the proof.

04

What the ordinary Monte Carlo central limit proves

Assume sigma squared is finite and strictly positive, and set W=(Y-mu)/sigma. Then E W=0 and E W squared=1. For real z, write exp(iz)=1+iz-z squared/2+r(z). Taylor expansion at zero gives r(z)/z squared tending to zero. There is a finite constant C with |r(z)|<=C z squared for every real z: use the Taylor bound for |z|<=1 and the triangle bound 2+|z|+z squared/2 for |z|>1. Consequently dominated convergence, with dominating variable C W squared, gives E r(tW)=o(t squared) as t tends to zero.

The characteristic function therefore satisfies phi_W(t)=1-t squared/2+o(t squared). For T_n=(W_1+...+W_n)/sqrt(n), independence gives phi_(T_n)(t)=[phi_W(t/sqrt(n))]^n. At any fixed real t the bracket is 1-t squared/(2n)+o(1/n). Taking the branch of the logarithm continuous near one gives n log(phi_W(t/sqrt(n))) tending to -t squared/2, and hence the characteristic functions tend to exp(-t squared/2). This step uses the full independence of the sample, not just its pairwise zero covariances.

We use the characteristic-function continuity theorem as an explicit foundational result: convergence to the characteristic function of an existing law that is continuous at zero implies weak convergence to that law. The limiting function here is that of a standard normal variable, whose law is already part of the Gaussian prerequisites. It follows that sqrt(n)(barY_n-mu)/sigma converges in distribution to that standard normal. The finite-variance Taylor argument above proves the required transform limit; it does not silently invoke a finite-sample normal law, a rate of convergence or a theorem for dependent chain states.

Let z be the positive standard-normal quantile satisfying Phi(z)=1-alpha/2 for 0<alpha<1. Continuity of the limiting distribution at both endpoints gives P(-z<=sqrt(n)(barY_n-mu)/sigma<=z) tending to 1-alpha. Thus barY_n plus or minus z sigma/sqrt(n) has asymptotic coverage with the true variance. Finite Bernoulli sums remain discrete and generally have different finite-n coverage. If sigma=0, the estimate is exactly mu almost surely and this standardized quotient is not defined. Repeated inspection or a random sample count is not justified by the fixed-n asymptotic assertion. Related reading: [From finite-dimensional limits to a path theorem](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf), [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf). The lesson derives the characteristic-function expansion and normal limit for iid finite-variance observations, using the continuity theorem as an admitted foundation. Durrett's path limit is contextual. Neither the normal limit nor the ordinary cost formula gives finite-n coverage.

05

Estimating variance and studentizing a mean

For n>=2 define s_n squared=(1/(n-1)) sum_i (Y_i-barY_n) squared. The exact algebraic identity sum_i (Y_i-barY_n) squared=sum_i (Y_i-mu) squared-n(barY_n-mu) squared follows by expanding around mu and using sum_i(Y_i-mu)=n(barY_n-mu). Each original square is nonnegative. Finite second moments and the exact sample-mean variance give E s_n squared=[n sigma squared-sigma squared]/(n-1)=sigma squared. For n=1 this formula has no denominator and is not an unbiased variance estimate by definition.

For an elementary complete almost-sure proof of variance consistency, assume the sufficient additional condition E[(Y-mu)^4]<infinity. The independent squared centered observations U_i=(Y_i-mu) squared then have finite variance and mean sigma squared. Applying the already proved finite-variance consistency argument to U_i and to Y_i gives (1/n) sum_i U_i tending almost surely to sigma squared and barY_n-mu tending almost surely to zero. The identity above, with n/(n-1) tending to one, proves s_n squared tends almost surely to sigma squared. The fourth moment is a stated sufficient assumption of this proof, not a claim that it is necessary for every general variance-consistency theorem.

When sigma>0, put R_n=s_n/sigma. Then R_n tends to one in probability, and P(s_n=0) tends to zero. Let Z_n=sqrt(n)(barY_n-mu)/sigma, which has the normal limit proved above and is therefore tight. On the event |Z_n|<=K and |R_n-1|<=delta<1/2, we have |Z_n/R_n-Z_n|<=2K delta. For any tolerance, first use tightness to choose K, next choose delta small enough, and then use R_n tending to one. This proves the difference tends to zero in probability. Bounding its distribution between the distributions of Z_n at x minus and plus a small tolerance, then using normal continuity, proves the same normal limit for the studentized quotient.

One may assign any fixed value to that quotient on the vanishing event s_n=0 for the asymptotic statement; an actual finite data report must retain the undefined-standard-error branch. The interval barY_n plus or minus z s_n/sqrt(n) consequently has limiting coverage 1-alpha under these assumptions. It is not an exact Student distribution unless further normal-sampling assumptions hold, and a zero empirical variance after a small sample does not certify sigma=0. If the observable itself is known constant, the mean is exact and the point interval covers it with probability one; division by zero is still unnecessary. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf), [From finite-dimensional limits to a path theorem](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf). The correction for estimating the sample mean gives the unbiased n−1 denominator. Strong consistency here uses a finite fourth moment and the previous strong law on squares. Slutsky's step requires positive limiting variance and handles a transient zero estimate separately.

06

A bounded-observable sample-size certificate

Suppose a<=Y<=b almost surely for known finite constants, and write R=b-a. For the centered variable Z=Y-EY, define L(theta)=log E exp(theta Z). Boundedness permits differentiating the expectation for every finite real theta. We have L(0)=L prime(0)=0, while L double-prime(theta) is the variance of Z under the exponentially tilted law. That law has the same interval support of length R. Its variance is no greater than its second moment about the interval midpoint, and that moment is at most R squared/4. Thus L double-prime(theta)<=R squared/4.

Integrate this bound twice from zero, in the appropriate direction for either sign of theta, to obtain L(theta)<=theta squared R squared/8. For independent observations, conditional iteration or direct factorization gives E exp(theta sum_i(Y_i-mu))<=exp(n theta squared R squared/8). Markov inequality with theta>0 therefore bounds P(barY_n-mu>=epsilon) by exp(-theta n epsilon+n theta squared R squared/8). When R>0 and epsilon>0, choosing theta=4 epsilon/R squared gives exp(-2n epsilon squared/R squared). Applying the same reasoning to -Y gives the lower tail.

The union bound yields P(|barY_n-mu|>=epsilon)<=2 exp(-2n epsilon squared/R squared), with the trivial probability bound one also available. For 0<alpha<1 a sufficient positive integer sample size is max(1,ceil[(R squared/(2 epsilon squared)) log(2/alpha)]). This is a finite fixed-sample certificate with the natural logarithm, not a normal approximation. The one-sided requirement instead uses log(1/alpha). The conditional-transform proof also explains why a suitable martingale version is possible, but an arbitrary adaptive or dependent experiment is not declared iid here.

If R=0, every observation is the known constant a and the error is zero for every positive n; neither an optimizing theta nor division by R is needed. The bounds a,b must be valid for the true observable, not merely the minimum and maximum observed so far. Epsilon has the observable units, so R squared/epsilon squared and the logarithm are dimensionless. Choosing a sample count after repeatedly checking ordinary fixed-n intervals requires a simultaneous guarantee such as the later confidence-sequence construction; this theorem alone does not provide one. Related reading: [Nonnegative supermartingales and time-uniform bounds](https://arxiv.org/pdf/1808.03204v8). A centered bounded-variable transform is proved by a two-point convexity bound and a second-derivative estimate. Independence and an exactly fixed n produce the stated two-sided guarantee. The range-zero branch is deterministic. Howard et al. supply the broader exponential framework.

07

Rare events and the information in zero successes

Let I_i be independent indicators of the same event with probability p, and let K=sum_i I_i and hatp=K/n for n>=1. Each indicator has mean p and variance p(1-p), so hatp is unbiased with variance p(1-p)/n. For p>0 its standard deviation divided by the true probability is sqrt((1-p)/(np)). This is a relative standard deviation, not a confidence-coverage probability. For p=0 the estimate is zero almost surely and that relative quotient is undefined; for p=1 it is exactly one.

Independence gives P_p(K=0)=(1-p)^n and P_p(K>=1)=1-(1-p)^n. For 0<p<1, a probability at least 1-alpha of seeing any success requires (1-p)^n<=alpha, or n>=log(alpha)/log(1-p), rounded upward to a positive integer. This detection requirement differs from a relative-error requirement. When np is small, a continuous normal approximation can obscure the substantial atom at zero; the exact zero-count calculation remains available without an approximation.

Fix 0<alpha<1 and put u=1-alpha^(1/n). Define a deliberately simple upper procedure U(K)=u when K=0 and U(K)=1 otherwise. For a true p<=u it never undercovers: U(K)>=p on both branches. For p>u, the only undercoverage event is K=0 and has probability (1-p)^n<(1-u)^n=alpha. The endpoints p=0 and p=1 also satisfy coverage directly. Thus P_p(p<=U(K))>=1-alpha for every p, proving the zero-success one-sided bound without pretending to give the full exact binomial interval for every count.

Zero successes leave an upper confidence limitA positive event rate still permits zero observations; The curve assumes the declared event rate. At the selected trial count, the zero-success outcome gives upper limit 0.1391083 by exact one-sided inversion. The lower panel resolves the neighboring counts 28 and 29. Only 29 and later counts satisfy the design threshold.Zero successes leave an upper confidence limit-0.03501.0350202932Zero-success probabilityDesign threshold αn=20Declared sample sizeTrial count · P(no successes) over the actual design range0.0360.0642728293031Zero-success probabilitiesExact α thresholdabove 1/20meets 1/20Last count above α and first count at or below αNeighboring integer trial counts · threshold detail
The curve assumes the declared event rate. At the selected trial count, the zero-success outcome gives upper limit 0.1391083 by exact one-sided inversion. The lower panel resolves the neighboring counts 28 and 29. Only 29 and later counts satisfy the design threshold.

The chance of zero successes is (1−p)^n under independence. Inverting the zero-count test gives the one-sided upper confidence limit. The design target uses a known hypothetical p and answers a different question from that confidence limit.

Exact zero-success and sample-size checks
QuantityExact result
P(0 successes at declared rate)(9/10)^20
Rounded zero-success probability0.1215767
Upper bound after observing zero1−(1/20)^(1/20)
Smallest count with probability ≤α29
Confidence level19/20
Exact previous trial comparison(9/10)^28 > 1/20
Exact qualifying comparison(9/10)^29 ≤ 1/20
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p1/10
n20
alpha1/20

After no successes all recorded indicators are zero and their empirical variance is zero, even though every p in (0,1) assigns that event positive probability. Zero empirical variance therefore cannot justify reporting an impossible event or a relative precision of zero. The upper bound depends on the fixed sample count, common p and independent-trial model. Dependence, a changing event probability or inspecting many counts before choosing a stopping point changes the experiment and needs its own proof. These limitations do not disappear by calling n an effective sample size. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf). For iid indicators the zero-count probability is exactly (1−p)^n. Inversion gives its own one-sided confidence procedure, with one reported after any hit. Relative variance requires p>0. The ordinary variance-cost comparison provides context, and a plug-in zero variance establishes no support statement.

08

Finite random inputs and numerical bias

For a positive integer M, let U be exactly uniform on the open unit interval and define J=floor(MU) and V_M=(J+1/2)/M. Apart from probability-zero grid boundaries, each of the M subintervals has probability 1/M, so J is uniform on {0,...,M-1}. Independent U values give independent J values. This proves the declared finite-grid sampling law; it does not say that a fixed deterministic generator has supplied such an experiment.

The coupling by the same U satisfies |V_M-U|<=1/(2M). If f is Lipschitz with constant L on [0,1], then |E f(V_M)-E f(U)|<=L E|V_M-U|. Integrating the distance to the midpoint in each subinterval gives E|V_M-U|=M times (1/(4M squared))=1/(4M), so the bias is at most L/(4M), and the weaker L/(2M) bound follows from the maximum distance alone. The estimate is a numerical-input bias bound with a stated regularity assumption; no such uniform conclusion is established here for an arbitrary discontinuous or singular f.

With n independent grid draws, the average has expectation E f(V_M) and variance Var(f(V_M))/n, when finite. Its bias relative to the continuous integral remains fixed as n grows at fixed M. Thus its mean-square error relative to that integral is the grid variance divided by n plus the squared grid bias. This elementary decomposition separates a finite-input approximation from random sampling error; increasing the number of repetitions does not repair a fixed discretization automatically.

A fixed seed and deterministic algorithm produce a fixed sequence. A probability law for a randomized seed can be specified, but independence of every emitted coordinate is then an additional joint-law assertion to establish or assume. Uniform individual marginals do not suffice: taking J_2=J_1 makes both grid values uniform while their average retains the variance of one observation rather than halving it. Period, empirical tests and apparent visual scatter do not prove the iid model for every observable. The finite-grid construction excludes U=1 so its floor never equals M, and transformations with singular endpoints require the explicit endpoint conventions proved next. Related reading: [Inverting a distribution with a uniform variable](https://artowen.su.domains/mc/Ch-nonunifrng.pdf), [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf). Couple each uniform input to the midpoint of its containing cell. Independent couplings across draws give iid grid observations. The integrand bias is bounded by the Lipschitz constant times half the grid width. A deterministic generator alone supplies no sampling distribution.

09

Inverse distributions with atoms and endpoints

Let F be a proper real distribution function: it is nondecreasing and right-continuous, tends to zero at minus infinity and to one at plus infinity. For 0<u<1 define Q(u)=inf{x in R:F(x)>=u}. The upper level set is nonempty because F tends to one, and it is bounded below because F tends to zero. Hence Q(u) is a finite real number. For every positive integer k, some point of the level set lies below Q(u)+1/k, so monotonicity implies F(Q(u)+1/k)>=u. Right-continuity then gives F(Q(u))>=u.

If x<Q(u), definition of the infimum gives F(x)<u. If x>=Q(u), the preceding attained-level fact and monotonicity give F(x)>=u. We therefore have the exact equivalence Q(u)<=x if and only if u<=F(x). The generalized inverse Q is nondecreasing and measurable. For U uniform on (0,1), this equivalence proves P(Q(U)<=x)=P(U<=F(x))=F(x) at every real x, including F(x)=0 or 1. This establishes the whole target law rather than merely its density at regular points.

An atom at a point a corresponds, up to endpoints of zero uniform probability, to u in (F(a-),F(a)], whose length is the jump probability. A gap in target support causes a jump in Q and contributes no unwanted mass inside the gap. A point mass at a constant is therefore sampled correctly without a density or a strictly increasing F. By contrast u=0 can give infimum minus infinity and u=1 can give an empty level set for an unbounded distribution, so their handling cannot be silently borrowed when a finite random-number routine assigns endpoints positive mass.

As a continuous example, for lambda>0 the exponential law has F(x)=0 for x<0 and F(x)=1-exp(-lambda x) for x>=0. Solving its level inequality gives Q(u)=-log(1-u)/lambda. The same probability calculation gives P(Q(U)>t)=exp(-lambda t) for t>=0, and integrating this nonnegative survival function gives mean 1/lambda. Lambda has inverse-time units when Q is a waiting time. Rate zero is not a finite waiting-time law obtained by this division; a no-arrival process uses its own infinite-wait convention. The general inversion theorem rests on the proper F and open uniform input, not on this particular formula. Related reading: [Inverting a distribution with a uniform variable](https://artowen.su.domains/mc/Ch-nonunifrng.pdf). Right continuity and the proper distribution limits give the inclusive generalized-inverse event. The opening printed inequality in Owen's proof is reversed, while the displayed distribution identity is inclusive. The lesson proves the equivalence with atoms, gaps and the open uniform endpoint convention.

10

A categorical sampler and a complete alias construction

Let p_1,...,p_m be nonnegative numbers with sum one, with m a positive integer. Put C_j=sum_(i<=j)p_i and C_0=0. For a uniform U in (0,1), choose the first index j with U<=C_j. Such an index exists because C_m=1, and its event is C_(j-1)<U<=C_j up to probability-zero equality conventions, giving probability p_j. An interval of length zero contributes no mass. This is the finite generalized-inverse construction; a strictly positive total is needed if unnormalized nonnegative masses are first divided by their sum.

For the alias construction, scale each mass to r_i=m p_i. Think of m columns, each of capacity one, whose total amounts of the different labels must be r_i. Maintain unfinished labels and columns with residual masses r_i whose sum equals their current number. If some residual r_s<1, there is another residual r_l>=1, since otherwise their average would be less than one. Finalize column s using label s on a fraction r_s and label l on the remaining fraction 1-r_s. Remove s and replace r_l by r_l-(1-r_s). This residual is nonnegative, and both the residual total and number of unfinished columns decrease by one.

The invariant says each original label’s allocated mass plus its remaining residual equals its original m p_i. Every pairing finalizes one column, so after at most m-1 pairings either one column remains or all remaining residuals are at least one. Their average is exactly one, so in the latter case they are all one and can be filled by their own labels. The one-column case also has residual one. Consequently all m columns have capacity one and the total assigned to label i is exactly m p_i. The m=1 and zero-residual cases are included without dividing by a zero probability.

Sample a uniform column J independently of a uniform within-column value V. Output its primary label if V is below that column’s recorded threshold, otherwise its recorded alias. Each unit of allocated label mass has unconditional probability 1/m, so label i is output with probability (m p_i)/m=p_i. With explicit small/large lists the construction uses at most m-1 constant-list-update pairings plus linear initialization, and a stored table uses one column lookup and test per draw in the stated exact-arithmetic model. Finite floating-point rounding and generation of exact uniform indices need their own implementation qualifications; the probability proof has not established them. Related reading: [Inverting a distribution with a uniform variable](https://artowen.su.domains/mc/Ch-nonunifrng.pdf), [Constructing an alias table](https://luc.devroye.org/chapter_three.pdf). Cumulative inversion establishes the finite law. The alias residual total equals the number of available columns after unit filling. This is the lesson's separate proof of termination, preservation of zeros and the column sampling distribution.

11

Rejection sampling and its random cost

Let q be a proposal density relative to a declared measure, and let h>=0 have finite positive normalizer Z=integral h. Suppose a known finite C>0 satisfies h(x)<=C q(x) almost everywhere. Draw X from q and an independent uniform V, and accept if V<=h(X)/(Cq(X)) on q(X)>0. On q=0 the dominated h is also zero almost everywhere, so the ratio can be assigned zero there without changing any sampled law. The envelope makes the acceptance probability lie in [0,1]; it is a genuine premise over the whole relevant support, not an observed maximum.

For every measurable A, the joint probability of proposing in A and accepting is integral_A q(x)h(x)/(Cq(x)) dx=(1/C) integral_A h(x) dx. In particular the acceptance probability is a=Z/C in (0,1], and conditioning on acceptance gives the density h/Z. The algorithm does not need the unknown Z to make an acceptance decision, although Z appears in its theoretical success probability. In the special case of a normalized target the usual envelope bound is recovered with Z=1.

For independent fresh proposal/test pairs, let K be the first accepted trial. Then P(K=k)=(1-a)^(k-1)a and P(K>k)=(1-a)^k for k>=0. Summing the nonnegative tail gives E K=sum_(k>=0)(1-a)^k=1/a=C/Z; in particular K is finite almost surely. Also P(K=k,X_K in A)=(1-a)^(k-1)(integral_A h)/C=P(K=k)(integral_A h/Z), so the accepted output has the target law independently of this trial count. Repeating with fresh independent pairs after each finite accepted index gives independent accepted outputs by conditioning on that index and summing its disjoint possibilities.

If the target normalizer is zero, there is no probability law h/Z to sample. If no finite valid envelope exists, this construction supplies no finite-cost rejection method. Choosing an invalid envelope and clipping acceptance at one generally produces a density proportional to min(h,Cq), as follows by replacing the joint acceptance integrand above; it does not repair the intended target. The expected proposal count must be included in a work comparison, together with the cost of evaluating h and q. The theorem proves the accepted law and its random work under exact inputs; it does not certify a guessed envelope or a dependent stream of proposals. Related reading: [Envelope sampling and its acceptance cost](https://artowen.su.domains/mc/Ch-nonunifrng.pdf). Domination covers the whole target support. Acceptance occurs with normalizer divided by envelope constant, gives the normalized conditional density and makes independent attempt count geometric. Owen's selected theorem starts from a normalized target, so the unnormalized calculation is explicit here.

12

Importance sampling and its best variance

Consider an absolutely integrable signed function f relative to a declared reference measure, with I=integral f and A=integral |f|<infinity. Let q be a probability density that is positive almost everywhere that f is nonzero. For X drawn from q define Y=f(X)/q(X), assigning zero on the irrelevant set q=0. Then E_q|Y|=A and E_qY=I by cancellation of the actual proposal density. If B=integral_(q>0) f squared/q is finite, the one-sample variance is B-I squared and the n-sample iid variance is (B-I squared)/n. A finite first moment does not by itself guarantee this second moment.

For A>0, Cauchy-Schwarz applied to |f|/sqrt(q) and sqrt(q) gives A squared<=B integral q=B. Equality is achieved by q_star=|f|/A on the nonzero-integrand set and zero elsewhere. Conversely the equality condition requires proportionality of those two factors wherever they carry mass, so the same proposal is necessary up to null sets. Under q_star, Y=A sign(f(X)), and its variance is exactly A squared-I squared. If the positive and negative integrals are P and N, this lower bound equals (P+N) squared-(P-N) squared=4 PN.

A nonnegative integrand with positive integral therefore has the ideal zero-variance proposal q_star=f/I; a one-signed negative integrand has the analogous conclusion. A genuinely signed integrand with both P and N positive has a strictly positive minimum variance even when I=0. If A=0, f is zero almost everywhere and the integral can be returned directly without normalizing |f|. These statements describe an optimum; drawing from |f|/A or evaluating its exact density may require precisely the normalizer or a sampler the original integration problem did not provide.

Proposal support comes before the variance comparisonA supported rare-event proposal eliminates variance when targeted; Signed importance values are 0 and 4/5. Only designs with the appropriate support enter the variance comparison. Upper panel compares signed quantities by outcome; lower panel compares only variances.Proposal support comes before the variance comparison-0.13600.9360102/5Target masses × signed rewards04/5Proposal-weighted observationsOutcome · target contribution and proposal-weighted observation-0.11501.72801236/254/250Valid variance at each designDesign: crude (0), declared (1), optimal (2) · variance
Signed importance values are 0 and 4/5. Only designs with the appropriate support enter the variance comparison. Upper panel compares signed quantities by outcome; lower panel compares only variances.

Each contribution is divided by the probability of sampling that outcome. Every nonzero target term needs positive proposal mass. The minimum second moment is the square of the sum of absolute target contributions, attained with proposal masses proportional to those absolute values.

Exact importance sampling values
QuantityExact result
Target expectation2/5
Target contributions by outcome(0, 2/5)
Proposal probabilities(1/2, 1/2)
Per-outcome importance values0 / 4/5
Crude variance36/25
Valid importance variance4/25
Variance-minimizing probability of outcome 11
Minimum valid variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p1/10
q1/2
a0
b4

For a target expectation, take f(x)=p(x)g(x), where p is the target density. The usual weight is w=p/q and the observation is wg. To support every observable and to have E_qw=1, q must cover the target support; for one fixed integral, covering the nonzero f set is the exact cancellation premise. Omitting positive integral mass or substituting a density other than the law actually sampled invalidates the proof. Correlated proposal draws keep the expectation identity under appropriate marginals but add covariance terms to the variance; the iid formula is not inherited merely from using correct weights. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf). Exact weighting integrates against the target with signed integrable observables and actual support. The Cauchy–Schwarz optimum concerns the absolute weighted integrand, with a separate zero integral and nonnegative exact-sampler branch.

13

A normalized ratio has a different sampling law

Let h>=0 have normalizer Z in (0,infinity), let q cover its support, and write W=h(X)/q(X) and G=Wg(X) for iid X drawn from q. Suppose E W squared and E G squared are finite; in particular E W=Z and E G=Zmu exist, where mu is the normalized target expectation. On batches with sum_i W_i>0, the self-normalized estimate is hatmu_n=sum_i G_i/sum_i W_i. The complete finite-variance consistency proof applied separately to W and G gives their averages tending almost surely to Z and Zmu. The denominator is eventually positive and the ratio tends almost surely to mu.

This ratio is not generally unbiased at finite n. With two equally likely proposal states, unnormalized target masses 1 and 3, and g values 0 and 1, a single observation has a strictly positive weight and its normalized ratio is just g(X), whose mean is 1/2. The normalized target mean is 3/4. Cancellation of numerator and denominator in a particular realization did not cancel the randomness of a ratio in expectation. For a general unbounded g, even existence of the finite-n ratio expectation requires attention; consistency alone does not establish it.

Put H=W(g-mu)=G-mu W. Its mean is zero and its second moment is finite by the two stated second-moment assumptions. The exact identity sqrt(n)(hatmu_n-mu)=[n^(-1/2) sum_i H_i]/barW_n holds on the positive-denominator branch. If E H squared>0, the ordinary iid central limit for H and barW_n tending to Z give the normal limit with variance E[W squared (g-mu) squared]/Z squared. The quotient step follows from the same tightness and denominator argument used for studentization. If E H squared=0, every H_i is zero almost surely, and the difference vanishes wherever defined, giving the degenerate limit.

Weights may vanish on proposal draws outside the target support; a batch of all zero weights has no normalized posterior or estimate. It must be recorded as undefined rather than assigned an arbitrary value and called unbiased. Multiplying h by a common positive constant scales both W and Z and leaves the ratio and the derived asymptotic variance unchanged. This benefit of avoiding a normalizer does not give an exact finite-sample normal interval. Adaptive proposals, dependent chain draws or a new variance estimator need their actual separate assumptions; they are not covered by relabeling this iid ratio calculation. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf). A ratio with a shared random denominator generally has finite-n bias. The centered weighted residual gives the asymptotic variance when the denominator has a positive mean. State the rule when all weights vanish, and retain the moment premises for the joint limit.

14

Weight effective sample size is a diagnostic

Take nonnegative realized weights w_1,...,w_n whose sum S_1 is strictly positive, and put S_2=sum_i w_i squared. Then S_2>0, and ESS_w=S_1 squared/S_2 is well defined. Nonnegative cross products give S_1 squared>=S_2, while Cauchy-Schwarz gives S_1 squared<=n S_2. Hence 1<=ESS_w<=n. The upper equality requires all n weights equal; under the positive-sum premise this common value is positive. The lower equality means at most one weight is nonzero. Multiplication by a common positive constant leaves ESS_w unchanged.

Equivalently, the normalized weights v_i=w_i/S_1 sum to one and ESS_w=1/sum_i v_i squared. This is an inverse concentration measure of that finite weight vector. If iid W>=0 has Z=E W>0 and a finite fourth moment, the earlier finite-variance strong-law proof applies both to W and to W squared. It follows that ESS_w/n=(barW_n squared)/(average W_i squared) tends almost surely to Z squared/E W squared. Jensen gives a limit in (0,1]. The fourth moment is an explicit sufficient condition for this elementary proof, rather than an unmentioned use of a more general integrable strong law.

For W=h/q with normalized target p=h/Z and covering proposal q, E W squared/Z squared=integral p squared/q. Subtracting one gives the finite chi-square divergence of p from q, so the population fraction is 1/(1+chi-square). This identifies what aspect of the proposal the weight statistic describes. It contains no observable g. In particular if q=p, all weights are equal and ESS_w=n, yet an event of probability epsilon can have relative standard deviation sqrt((1-epsilon)/(n epsilon)) and zero-success probability (1-epsilon)^n. Those can be large while the weight statistic is maximal.

Conversely, a constant observable has an exact self-normalized estimate on every positive-weight batch even if only one weight is nonzero. Thus the same weight concentration can accompany very different actual integration errors. All-zero or signed weights lie outside the displayed bounds. Equal weights on consecutive dependent chain states also fail to establish independence; their correlation effective sample size is a different variance-based quantity and can exceed n under negative correlation. Weight ESS is therefore a useful diagnostic with a proved meaning, not a universal substitute for an error bar or a sampling-law proof. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf). The scale-invariant squared-sum diagnostic follows from elementary weight inequalities and laws of large numbers for first and second moments. Its population relation to squared weights gives no uniform observable-error or serial-correlation guarantee.

15

A defensive proposal bounds the weights

Let p be a normalized target density, q_0 a proposal density and 0<delta<=1. Define q_delta=(1-delta)q_0+delta p. This is a probability density and q_delta>=delta p. Therefore the ordinary importance weight w=p/q_delta satisfies 0<=w<=1/delta on the proposal support, using zero when p=0. The target is covered, and E_(q_delta)w=1. The same bound does not follow at delta=0; it is the positive defensive component that supplied it.

If E_p g squared<infinity, the importance observation Y=wg has mean mu=E_pg. Its second moment is integral p squared g squared/q_delta<=delta^(-1) integral p g squared, so Var(Y)<=delta^(-1)E_p g squared-mu squared. For n independent draws, divide this bound by n. More generally, for any fixed known constant c the observation c+w(g-c) is unbiased and has variance at most delta^(-1)E_p(g-c) squared-(mu-c) squared. Choosing c=mu would give the theoretical bound Var<=Var_p(g)/delta, although that unknown choice is not supplied as an implementable control.

If |g|<=B, the weighted observation lies in [-B/delta,B/delta], giving a valid known range for the bounded-observation certificate under iid sampling. Actual target draws can be mixed by an independent Bernoulli choice: with probability delta draw from p, otherwise from q_0. That procedure indeed has density q_delta. However it presupposes exact sampling access to p and evaluation of the actual mixture density. A target known only through an unnormalized h need not supply either a normalized p value or an exact target sampler; the existence of this mathematical mixture does not solve that access problem.

A practical variant uses a known safe density r with an established bound p<=K r: replacing the defensive p component by r gives p/q_delta<=K/delta by the same argument. The bound K must hold on the whole target support, not just sampled points. Costs of the two mixture branches may differ and belong in an equal-work comparison. At delta=1 the original theorem is simply target sampling; a zero observable or zero target mass is handled directly. None of these weight bounds corrects a separate scientific error in choosing p as the model. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf). Defensive mixing with the normalized target gives a pointwise weight ceiling and an integrated second-moment bound. The bound presupposes a positive target fraction and the actual exact sampling and normalized mixture needed by that statement.

16

Adapting a proposal without changing the target

At step k, let the complete past be F_(k-1), choose a proposal density q_k measurably from that past, and then draw X_k with exactly that conditional density. Let the fixed target be normalized p and the fixed observable g have mean mu. Require conditional support coverage wherever pg is nonzero and enough absolute integrability. The observation Y_k=p(X_k)g(X_k)/q_k(X_k) then satisfies E[Y_k|F_(k-1)]=integral pg=mu. Thus D_k=Y_k-mu is a martingale difference, even though the proposals and observations are generally dependent across k.

For a fixed positive n, assume E D_k squared<infinity for every k<=n. For i<j, D_i is measurable at time j-1, and conditioning gives E D_iD_j=E[D_i E(D_j|F_(j-1))]=0; Cauchy-Schwarz ensures the product is integrable. Consequently E[(n^(-1)sum_k Y_k-mu) squared]=n^(-2)sum_k E[Var(Y_k|F_(k-1))]. This is an exact finite mean-square identity. A uniform bound V on the expected conditional variances gives V/n. It does not state that an empirical iid sample variance has estimated those terms correctly.

If additionally each Y_k lies in a known past-measurable interval whose deterministic length is c_k, the conditional tilted-variance proof gives E[exp(theta D_k)|F_(k-1)]<=exp(theta squared c_k squared/8). Iterating conditional expectation bounds the transform of the sum by exp(theta squared sum_k c_k squared/8). Optimizing the upper and lower Chernoff bounds gives P(|average Y_k-mu|>=epsilon)<=2 exp(-2n squared epsilon squared/sum_k c_k squared), with the all-zero-range case direct. This certificate uses actual conditional bounds; adaptation by itself is neither a variance guarantee nor an iid central limit.

The timing condition is essential. For example, first draw X uniformly from two target states with target masses 1/2 each, then define a purported proposal to assign probability 3/4 to the realized state and 1/4 to the other. Both support probabilities are positive, but with g=1 the purported importance observation is always (1/2)/(3/4)=2/3 rather than having mean one. The postselected density was not the conditional proposal used to draw X. Learning q_k from earlier data is compatible with the proof; selecting it using the same unseen-current outcome and weighting as if it came first is not. A random terminal sample count also needs an additional stopping argument. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf), [Nonnegative supermartingales and time-uniform bounds](https://arxiv.org/pdf/1808.03204v8). The exact conditional density at step k gives conditional integration against the unchanged target. Martingale difference orthogonality gives the mean-square identity under square integrability. The broader time-uniform reading does not license an iid error formula for adaptive draws.

17

Multiple proposals and the balance denominator

Let q_1,...,q_m be fixed proposal densities and choose nonnegative integer counts n_j with n=sum_j n_j>0. Write alpha_j=n_j/n and q_bar=sum_j alpha_j q_j. Independently sample all X_(j,i) from their specified q_j. Let h be an absolutely integrable target integrand and suppose q_bar>0 wherever h is nonzero. Define H(x)=h(x)/q_bar(x), using zero on q_bar=0. For an active component alpha_j>0, q_bar>=alpha_j q_j, so a q_j sample reaches no positive-probability set where this denominator is zero.

The balance estimate is I_hat=(1/n)sum_(j,i)H(X_(j,i)). Its expectation is sum_j alpha_j integral q_j h/q_bar=integral h=I, because the component densities sum to the actual allocation mixture. No individual component needs to cover the whole target if their mixture does. This differs from replacing the denominator by each separate q_j and assuming every separate importance estimate is valid. Components with zero allocation have no draws and no contribution to the denominator.

Suppose B=integral h squared/q_bar is finite. Every active component then has finite E_(q_j)H squared, since it is at most B/alpha_j. Independence of all the draws gives Var(I_hat)=(1/n)sum_j alpha_j Var_(q_j)(H). Put mu_j=E_(q_j)H, so sum_j alpha_j mu_j=I. Expanding the variance of H under the mixture gives Var_(q_bar)(H)=sum_j alpha_j Var_(q_j)(H)+sum_j alpha_j(mu_j-I) squared. Thus the fixed-allocation variance is no larger than the variance of an average of n independent draws from that same mixture weighted by the same H.

Equality in this comparison occurs exactly when all active component means mu_j agree. It is a comparison at a declared number of draws, not a claim that evaluating all mixture densities or sampling every component has the same work cost in every application. The coefficients alpha_j must match the actual fixed allocation; random data-dependent allocations need a separate conditional analysis rather than substituting realized counts into this proof. If the target normalizer is unknown, the same reasoning can estimate its unnormalized numerator and denominator, but their normalized ratio has the finite-sample bias distinction already proved above. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf), [Independent strata and continuous allocation](https://artowen.su.domains/mc/Ch-var-basic.pdf). The denominator is the allocation-weighted mixture on the target support. Fixed independent sample groups omit the between-group part of the iid mixture variance. Zero allocations do not have sampling terms. The exact fixed-allocation comparison follows by total variance.

18

Control variates and independent coefficient fitting

Let Y have target mean mu and finite variance, and let C be a finite vector of finite-second-moment controls whose exact mean m is known. Write Z=Y-mu, D=C-m, Sigma=E[DD transpose] and c=E[D Z]. For any fixed coefficient vector beta, the adjusted observation A_beta=Y-beta transpose D has expectation mu. Expanding its centered square gives Var(A_beta)=sigma_Y squared-2 beta transpose c+beta transpose Sigma beta. This identity includes all cross-control covariances; subtracting separate univariate corrections without them does not solve the general problem.

The symmetric covariance matrix Sigma is positive semidefinite. If v belongs to its kernel, E(v transpose D) squared=v transpose Sigma v=0, so v transpose D=0 almost surely and v transpose c=0. Thus c is orthogonal to the kernel and belongs to the range of Sigma. There exists beta_0 with Sigma beta_0=c; in an orthonormal eigenbasis it is obtained by dividing the c coordinate by each positive eigenvalue and choosing zero coordinates in the null space. Completing the quadratic gives Var(A_beta)=sigma_Y squared-beta_0 transpose c+(beta-beta_0) transpose Sigma(beta-beta_0). This proves the minimum and all minimizing coefficients, including singular controls.

For a positive definite Sigma the unique minimizer is Sigma inverse c, and the minimum variance is sigma_Y squared-c transpose Sigma inverse c. For singular Sigma, adding a kernel vector to beta_0 changes neither the adjusted observation nor its variance. The minimum is nonnegative because it is the variance of an actual residual; a perfect linear control can make it zero. A constant control has zero centered value and cannot reduce variance further. Control means must be known under the actual target law: replacing m by an inaccurate number introduces the corresponding coefficient-weighted bias. Coefficients have the units needed to make beta transpose D comparable to Y.

An exact centered control preserves the target meanA perfect control removes the variation; Both series have mean 3. The adjusted variance is 0, compared with 5 before adjustment.An exact centered control preserves the target mean-0.8406.84-0.273.270246Raw Y3333Adjusted observationShared exact meanUniform scenario index · observable value
Both series have mean 3. The adjusted variance is 0, compared with 5 before adjustment.

Subtract β times the centered control, whose mean is zero. Minimizing the resulting quadratic variance gives Cov(Y,C)/Var(C) when Var(C)>0. A coefficient estimated on the same finite data needs separate analysis.

Exact centered control calculation
QuantityExact result
Observable mean / control mean(3, 3/2)
Observable variance / control variance(5, 5/4)
Covariance5/2
Optimal coefficient2
Adjusted variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
points[[0,0],[2,1],[4,2],[6,3]]

If a coefficient B is fitted from an independent training sample, condition on that sample. Fresh independent validation observations retain mean mu and variance Var(A_B)/n for their average. Under sufficient integrability, unconditioning gives exact unbiasedness and variance E[Var(A_B)]/n, since the conditional mean is the same constant. Fitting B on the same observations does not by this argument preserve unbiasedness. Cross-fitting can preserve the mean term by term when each coefficient is trained outside its evaluation fold, but its fold terms may be mutually dependent and require their actual cross covariances. Training cost belongs in a total-work comparison; the ideal known-covariance minimum is not automatically achieved by an estimated coefficient. Related reading: [Known-mean controls and estimated coefficients](https://artowen.su.domains/mc/Ch-var-basic.pdf). The covariance quadratic includes zero-variance and redundant controls. A null direction has zero covariance with the centered output, so the normal equation is solvable. An independent training sample preserves conditional unbiasedness. Same-sample fitting is qualified separately.

19

Antithetic sampling at an equal work budget

Let U have a declared input law and let T preserve that law. Suppose Y=f(U) and Y_star=f(T(U)) have common finite mean mu and variance sigma squared. Their average A=(Y+Y_star)/2 is unbiased, and direct expansion gives Var(A)=(sigma squared+c)/2, where c=Cov(Y,Y_star). With m independent input pairs the estimator variance is (sigma squared+c)/(2m). At the same total count of 2m function evaluations, independent sampling would have variance sigma squared/(2m). Thus the improvement or loss depends on the actual sign of c, not just on calling a transformation antithetic.

For independent copies U,U_prime and square-integrable functions h,k, expansion gives Cov(h(U),k(U))=(1/2)E[(h(U)-h(U_prime))(k(U)-k(U_prime))]. If U is uniform on (0,1), h=f is nondecreasing, and k(u)=f(1-u), then k is nonincreasing. For every pair of real inputs the two differences have opposite signs or one is zero, making their product nonpositive. The covariance is therefore nonpositive. The same reasoning works if f is nonincreasing. Reflection preserves the uniform law, so both unbiasedness and the equal-cost variance comparison have been proved in this stated setting.

Cauchy-Schwarz gives -sigma squared<=c<=sigma squared. At c=-sigma squared the pair mean is constant almost surely and its variance is zero. For example an affine function of a uniform variable has a constant reflected pair mean. At c=sigma squared the two values coincide after centering, and a pair has the variance of only one observation despite costing two evaluations. A nonconstant symmetric function f(u)=f(1-u) realizes that latter situation, showing why law preservation alone gives no variance reduction.

Equal work makes the pairing comparison meaningfulLinear antithetic partners cancel exactly; The pair uses two function evaluations. Its variance is 0 versus 1/24 for two independent evaluations.Equal work makes the pairing comparison meaningful-0.1401.14-0.091.09g(u)g(1−u)Pair meanUniform input u · paired evaluations
The pair uses two function evaluations. Its variance is 0 versus 1/24 for two independent evaluations.

Expand the variance of the average. Covariance vanishes for independent evaluations but equals the integral of g(u)g(1−u) minus the squared mean in the paired design. The sign of this covariance determines whether pairing helps.

Exact equal-budget comparison
QuantityExact result
Mean1/2
One-evaluation variance1/12
Covariance of paired evaluations−1/12
Independent two-evaluation mean variance1/24
Antithetic pair mean variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
gu

Independent replications of pairs are part of the displayed averaging variance; one shared base input for every pair would not provide them. Shared computation may change the cost per pair and must be counted explicitly before interpreting an equal-work gain. The zero-variance observable is direct, and no relative improvement ratio is taken when sigma=0. A transformation that changes the input marginal can bias the integral, even if its outputs appear negatively correlated. The proof concerns exact input and transformation laws rather than an empirical correlation from a selected finite run. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf). The scalar monotone reflection has nonpositive covariance by the independent-copy covariance identity. Equal evaluation counts control the cost comparison. Applying reflection to an even centered function supplies a contrary example, and strict or multivariate benefits are not presumed.

20

Common random numbers compare two models

Suppose a common input U produces model outputs Y=f(U) and Z=g(U) with the desired marginal laws and finite second moments. The paired difference D=Y-Z has mean E Y-E Z regardless of its covariance. Expansion gives Var(D)=sigma_Y squared+sigma_Z squared-2c, where c=Cov(Y,Z). Averaging m independent input pairs divides this variance by m. Estimating the two means from two independent collections of m outputs instead has difference variance (sigma_Y squared+sigma_Z squared)/m.

At the same declared counts of model evaluations, common random numbers improve the difference estimate when c>0 and worsen it when c<0; exact equality of the two model outputs can make the difference variance zero. The covariance bound |c|<=sigma_Y sigma_Z follows from Cauchy-Schwarz and keeps every derived variance nonnegative. For real monotone outputs of the same scalar uniform input, the independent-copy covariance identity has nonnegative pointwise product when both functions increase, giving a useful proved positive-covariance construction. Arbitrary shared inputs need not have that monotonicity.

For a sensitivity comparison, write D_h=f(theta+h,U)-f(theta,U). If |D_h|<=|h|M(U) for a square-integrable envelope M, then E[(D_h/h) squared]<=E M squared. Thus the same-input finite-difference observation can have a bounded second moment as h tends to zero, while the variance of two independent noisy values divided by h squared can grow like h^(-2). This is a variance statement for the finite difference. Identifying its mean limit with a derivative still requires a legitimate differentiation-under-expectation argument, supplied later under explicit domination; a discontinuous payoff need not satisfy this pathwise bound.

The coupled inputs must retain each model’s actual marginal experiment. Reusing a seed label without establishing the joint sampling construction does not prove those marginals or the required sign of covariance. Replicate pairs also need independent underlying inputs for the variance to divide by m. If the two models share expensive computations, the paired cost may differ from the independent cost, and a measured or declared work model must accompany an efficiency claim. Correlated errors help a difference only through the displayed covariance term; they do not by themselves improve either absolute model estimate or remove a model bias. Related reading: [Shared inputs and conditional estimators](https://artowen.su.domains/mc/Ch-var-basic.pdf). The mean of the difference depends on the two marginals and the variance depends on the actual coupling. Shared inputs are compared at equal cost, with neither a universal sign nor a borrowed finite-difference MSE rate.

21

Stratification separates between-cell variation

Partition the target probability space into finitely many disjoint measurable cells A_h with known probabilities pi_h summing to one. Ignore zero-probability cells, and for each positive cell define mu_h=E[Y|A_h] and sigma_h squared=Var(Y|A_h). Suppose E Y squared is finite. Independently within and across cells, draw n_h>=1 observations from the actual target conditional law on that cell. The stratified estimate is I_hat=sum_h pi_h barY_h. Its expectation is sum_h pi_h mu_h=mu; the conditional draws need not be uniform in space unless the target law makes them uniform.

Independence and the exact within-cell variance give Var(I_hat)=sum_h pi_h squared sigma_h squared/n_h. To compare with unstratified iid sampling, decompose Y-mu=(Y-mu_h)+(mu_h-mu) on cell h. The first term has conditional mean zero, so expansion and conditioning give sigma squared=sum_h pi_h sigma_h squared+sum_h pi_h(mu_h-mu) squared. This is the full between-cell and within-cell variance identity, including the target probabilities.

If a total count n has feasible proportional integer allocations n_h=n pi_h>=1, then Var(I_hat)=(1/n)sum_h pi_h sigma_h squared<=sigma squared/n. The removed term is exactly the between-cell variation divided by n. Equality holds when all positive-cell means agree. For an allocation other than this proportional one, the general variance formula must be evaluated; an arbitrary stratification with too few draws in a variable cell need not beat iid sampling. Irrational probabilities may make exact proportional allocation impossible at a finite n, and rounding is not silently treated as equality.

A positive-probability cell cannot simply be omitted while its unknown contribution remains in the target. An analytically known contribution can instead be inserted exactly, and a truly constant conditional observable is learned from one exact draw rather than a nonexistent zero-draw average. Estimated cell probabilities or approximate conditional samplers add their own errors and may destroy the stated unbiasedness. Setup and conditional-sampling work can also differ by cell. The mathematical variance reduction therefore rests on known cell masses, correct conditional laws and the declared independent positive allocations, rather than on labeling a sample by strata after seeing its values. Related reading: [Independent strata and continuous allocation](https://artowen.su.domains/mc/Ch-var-basic.pdf). Known cell weights and independent within-cell samples give the stated variance. Proportional integer allocations and zero-mass cases are handled explicitly. Total variance identifies which part of iid variability is removed.

22

Allocating samples by variance and cost

Write a_h=pi_h sigma_h for the nonnegative standard-deviation contributions in the stratified variance V=sum_h a_h squared/n_h. First allow positive real allocations with total sum_h n_h=n. Cauchy-Schwarz applied to a_h/sqrt(n_h) and sqrt(n_h) gives (sum_h a_h) squared<=Vn. If A=sum_h a_h>0, equality on positive a_h is achieved by n_h=n a_h/A, giving the relaxed minimum A squared/n. This proves the continuous Neyman allocation from the exact variance formula rather than guessing it from the cell sizes.

Now let each draw in cell h cost a known c_h>0 and let the relaxed work budget be B=sum_h c_h n_h. Applying the same inequality to a_h/sqrt(n_h) and sqrt(c_h n_h) gives (sum_h a_h sqrt(c_h)) squared<=VB. If A_c=sum_h a_h sqrt(c_h)>0, equality requires n_h=B a_h/[sqrt(c_h) A_c], and substitution gives minimum variance A_c squared/B. Variable cells that are cheap to sample receive more draws relative to their standard deviation, with the exact cost square root shown by the equality condition.

Zero-variance cells contribute no sampling variance, but a zero allocation still supplies no unknown conditional mean. Reserve a draw or an exact known contribution as needed before applying the relaxed positive-variance allocation to the remaining budget. If every a_h=0, there is no variance term to optimize and these normalization formulas are not used. Real-valued optimal counts are not actual sample counts. Rounding each positive ideal count upward can only reduce its variance contribution and increases work by less than the sum of the corresponding c_h, but it can exceed a strict fixed budget; that budget needs an admissible integer allocation.

Within-stratum variance depends on the actual fixed allocationDifferent strata reduce within-cell variance; Fixed counts allocate the declared evaluation budget across strata. The deterministic stratum, when present, contributes zero conditional variance. The fixed counts are n₁=4 and n₂=4.Within-stratum variance depends on the actual fixed allocationCrude · Total1/32Stratified · Total3/128Stratum 1 (n=4) · Part3/256Stratum 2 (n=4) · Part3/25600.0313Variance of the estimated mean
Fixed counts allocate the declared evaluation budget across strata. The deterministic stratum, when present, contributes zero conditional variance. The fixed counts are n₁=4 and n₂=4.

At fixed stratum counts independent stratum means add with weights w. Their variances are σ²/n within each stratum, so the weights enter squared. The continuous optimum under equal evaluation cost allocates in proportion to wσ, before any integer or identification constraints.

Exact within-cell variance and allocation
QuantityExact result
Target mean1/2
Conditional variances(3/16, 3/16)
Stratified contributions(3/256, 3/256)
Stratified total variance3/128
Equal-work crude variance1/32
Continuous Neyman shares0.5 / 0.5
Zero-variance stratumA known deterministic contribution needs no repeated sampling. An unknown deterministic value still needs an observation.
Exact inputs and supporting calculations
Declared inputs
ParameterValue
w["1/2","1/2"]
p["1/4","3/4"]
n[4,4]

The formula uses true conditional variances and costs. If these are estimated by a pilot, the resulting allocation is a random estimate of an optimum, not a proof that the ideal variance was attained. With independent validation draws, conditioning on the pilot still gives an unbiased stratified mean and conditional variance sum_h pi_h squared sigma_h squared/n_h(pilot), whose expectation is the actual unconditional variance. Reusing pilot observations or random stopping within cells requires its own analysis. Pilot, setup and rounding work must be included before comparing a practical scheme with the continuous bound. Related reading: [Independent strata and continuous allocation](https://artowen.su.domains/mc/Ch-var-basic.pdf), [Coupled level corrections and multilevel complexity](https://people.maths.ox.ac.uk/~gilesm/files/acta15.pdf). Continuous cost weighting gives allocation proportional to cell probability times its standard deviation divided by the square root of its cost. Rounding, minimum required samples and zero-variance cells have explicit costs. Unknown pilot variances make this a planning formula.

23

Conditioning before simulation

Let Y belong to L2 and let G be the information retained for a conditional calculation. Put H=E[Y|G]. Conditional Jensen gives E H squared<=E Y squared, so H also has a finite second moment and E H=E Y=mu. The residual Y-H is orthogonal to H-mu: conditioning gives E[(Y-H)(H-mu)]=E[(H-mu)E(Y-H|G)]=0. Expanding Y-mu=(Y-H)+(H-mu) proves Var(Y)=E[(Y-H) squared]+Var(H). Thus exact conditioning preserves the mean and removes a nonnegative variance component.

Independent outer draws of the conditioning variable yield independent copies of H and divide its variance by the number of outer draws. If H is instead estimated by m independent inner draws from the exact conditional law, write their average as H_hat_m. Conditional mean is H and conditional variance is v(G)/m, where v(G)=Var(Y|G). Applying the same decomposition gives Var(H_hat_m)=Var(H)+E v(G)/m. Exact analytic conditioning removes this inner sampling term; an approximate deterministic conditional value can instead add bias and is not covered by the equality.

For a threshold payoff Y=1_(X+V>t) with independent inputs and a known distribution function F_V, conditioning on X gives H(X)=1-F_V(t-X). The strict inequality uses this upper tail even when V has atoms. For independent uniforms on (0,1) and threshold t=1, H(X)=X, with mean 1/2 and variance 1/12 from the elementary first two uniform moments. The original indicator has mean 1/2 and variance 1/4. This explicit example demonstrates removal of the conditional indicator noise rather than relying on a general claim that smoother output is always better.

Variance per observation is not variance at a fixed work budget. If an output with variance v costs a fixed c work units and setup is ignored, B/c independent copies give variance vc/B up to integer counts. An exact conditional computation that is very expensive may therefore lose its equal-work advantage. Estimated conditional distributions, shared outer draws or correlated inner samples change the preceding variance formula and need their actual errors or covariance terms. The proved reduction applies to the true conditional expectation and true independent replication; it is not a guarantee for any fitted regression labeled a conditional estimator. Related reading: [Shared inputs and conditional estimators](https://artowen.su.domains/mc/Ch-var-basic.pdf). Conditional averaging removes a nonnegative residual variance by the L² projection identity. The threshold example uses a known conditional law, with exact event direction and units. Estimating that conditional expectation or spending more work changes the comparison.

24

One random point per interval

Split (0,1) into n intervals I_j=((j-1)/n,j/n) of length h=1/n, and draw independent U_j uniformly in their respective intervals. Define I_hat=(1/n)sum_j f(U_j), assuming f is integrable. Since E f(U_j)=n integral_(I_j) f(x) dx, linearity gives E I_hat=integral_0^1 f(x) dx. This is proportional stratification with one point in each equal-probability cell, not a single iid collection whose locations happen to cover the cells.

Suppose f is Lipschitz with constant L. For independent copies U,U_prime within one interval, 2 Var(f(U))=E[(f(U)-f(U_prime)) squared]<=L squared E[(U-U_prime) squared]=2L squared Var(U). Direct integration gives Var(U)=h squared/12, so every within-cell variance is at most L squared/(12n squared). Independence across cells now gives Var(I_hat)=n^(-2)sum_j Var(f(U_j))<=L squared/(12n cubed). This establishes the n^(-3) variance bound using the actual random stratified rule.

For f(x)=a x+b, every step in that variance bound is an equality with L=|a|, and Var(I_hat)=a squared/(12n cubed). The same n independent unstratified uniform observations have mean variance a squared/(12n), so the factor is n squared when a!=0. More generally the exact total-variance argument for proportional stratification already guarantees no larger variance than iid sampling for any square-integrable f; the Lipschitz assumption supplies the stronger explicit rate. Constants give zero error directly.

Independent jitter matters: using a single common shift for all cells preserves uniform one-point marginals but adds cross-cell covariances, so this sum-of-independent-variances proof no longer applies. A deterministic midpoint average has no sampling randomness under a fixed-input experiment and hence no statistical standard error; it can still have a deterministic quadrature error. The earlier midpoint coupling gives a Lipschitz bias bound L/(4n) for that deterministic average. These are different error statements, and finite precision or approximate within-cell uniforms must retain their own input-law qualification. Related reading: [Independent strata and continuous allocation](https://artowen.su.domains/mc/Ch-var-basic.pdf), [Star discrepancy and bounded variation](https://artowen.su.domains/mc/practicalqmc.pdf). Independent uniform jitter gives variance equal to the sum of cell variances divided by n². The independent-copy Lipschitz estimate bounds each cell's variance by L²/(12n²) and yields L²/(12n³). It is a randomized rule distinct from the deterministic quadrature bound.

25

A deterministic discrepancy bound

Let a_1,...,a_n be fixed points in [0,1], with n>=1, and set F_n(t)=(1/n)sum_i 1_(a_i<=t). Define their one-dimensional star discrepancy D_star=sup_(0<=t<=1)|F_n(t)-t|. Suppose f is absolutely continuous on [0,1] with integrable derivative, so f(x)=f(1)-integral_x^1 f prime(t) dt. This regularity is explicit; an almost-everywhere derivative by itself is not a substitute for absolute continuity.

Averaging the displayed representation over the finite point set gives (1/n)sum_i f(a_i)=f(1)-integral_0^1 F_n(t)f prime(t) dt, with any equality-endpoint differences on finitely many t irrelevant to the Lebesgue integral. Integrating the same representation over uniform x and using integrability of f prime gives integral_0^1 f(x) dx=f(1)-integral_0^1 t f prime(t) dt. Subtraction therefore expresses the quadrature error exactly as -integral_0^1 [F_n(t)-t]f prime(t) dt.

Taking absolute values bounds that error by D_star times V, where V=integral_0^1 |f prime(t)|dt. For midpoint points a_j=(j-1/2)/n, the empirical distribution differs from t by at most 1/(2n) between successive jumps, and the one-sided jump limits attain this supremum. Hence their deterministic error is at most V/(2n). If f is constant, V=0 and the identity is exact. A different Lipschitz coupling can give a stronger bound in its narrower setting; it does not alter this integration-by-parts proof.

The point set and its error in this theorem are deterministic, so an iid sample variance or a normal standard error is not justified by the rule. A randomized point set needs a probability law and a separate replication argument. The theorem proves the stated one-dimensional absolutely continuous case, not the full multidimensional Hardy-Krause inequality or a rate for every irregular integrand. In higher dimensions both the relevant discrepancy and the integrand variation change. The next randomized torus construction instead gives an explicit unbiasedness and frequency-based variance result under its own Fourier assumptions. Related reading: [Star discrepancy and bounded variation](https://artowen.su.domains/mc/practicalqmc.pdf). The one-dimensional proof takes the boundary terms and interval convention into account before applying the discrepancy norm. Absolute continuity and integrable derivative are the premises. The broader bounded-variation result is context only.

26

Random shifts and lattice frequency cancellation

Work on the d-dimensional unit torus with normalized Lebesgue probability. Fix N deterministic points a_j, allow repetitions, take one uniform random shift U, and set A(U)=N^(-1) sum_j f((a_j+U) mod 1). For any integrable real f, translation preserves measure, so each shifted term has mean I=integral f and E A=I. This argument does not make the N points independent. For square-integrable f the finite averaging operator is a contraction: Jensen gives integral |A| squared <=N^(-1) sum_j integral |f(a_j+u)| squared=integral |f| squared. In particular its variance is finite. The probability space is the random shift; a deterministic low-discrepancy rule alone has no such sampling expectation.

First take a trigonometric polynomial f(u)=sum_k fhat_k exp(2 pi i k dot u), with finitely many integer-frequency vectors k. Substitution gives A(U)-I=sum_(k nonzero) fhat_k a(k) exp(2 pi i k dot U), where a(k)=N^(-1) sum_j exp(2 pi i k dot a_j). Integrating the squared modulus eliminates distinct frequencies because the integral of exp(2 pi i (k-l) dot u) is zero unless k=l. Thus Var(A)=sum_(k nonzero) |fhat_k| squared |a(k)| squared. For general L2 f, use the analysis input that trigonometric polynomials are dense in L2 and their coefficients satisfy Parseval. Approximate f by those polynomials; the averaging contraction makes their shifted averages converge in L2 as well. The coefficient multiplier has absolute value at most one, so the coefficient sums converge in the square-summable norm and yield the same variance series. Density and Parseval are explicitly admitted Fourier inputs, not conclusions from a finite sample.

For a rank-one lattice use j=0,...,N-1 and a_j=j z/N modulo one, with integer vector z. At frequency k the multiplier is the finite geometric sum N^(-1) sum_j exp(2 pi i j (k dot z)/N). If k dot z is divisible by N every term is one. Otherwise its ratio is an Nth root of unity different from one, and multiplying the geometric sum by one minus that ratio gives zero, so the sum is zero. Consequently only nonzero dual frequencies satisfying k dot z=0 modulo N contribute: Var(A)=sum_(k nonzero,k dot z divisible by N) |fhat_k| squared. The algebra remains true if z creates repeated points, although repetitions may destroy useful cancellation. Frequencies that resonate with the lattice are not made small merely by increasing the nominal point count.

With R independent shifts let A_1,...,A_R be the resulting replicate averages. They are iid scalar outputs with mean I and the variance just derived; their overall mean has variance Var(A)/R. Their sample variance is unbiased when R>=2; normal-limit error bars need their own asymptotic assumptions, and consistency of the variance follows under the moment conditions stated earlier. Treating the NR within-shift values as independent would omit their covariances. Cancellation helps when the actual Fourier coefficients are small on surviving frequencies, while a resonant cosine can retain its full variance. This proof therefore supplies unbiasedness and an exact spectral variance identity, not a universal error rate for every integrand or an independence certificate for a shifted point set. Related reading: [Star discrepancy and bounded variation](https://artowen.su.domains/mc/practicalqmc.pdf), [Random shifts and lattice frequencies](https://www.informs-sim.org/wsc00papers/070.PDF). Uniform shift preserves the integral, and L² Fourier orthogonality gives exact surviving-frequency variance. The conference paper prints the dual-lattice condition and refers elsewhere for proof. The lesson proves cancellation by a finite geometric sum and estimates uncertainty across independent shifts.

27

Metropolis acceptance preserves the target

Let a finite state set S carry a target pi_x>0 with sum_x pi_x=1 and a proposal matrix q. For x different from y define alpha(x,y)=min(1,pi_y q_yx/(pi_x q_xy)) whenever q_xy>0; if q_yx=0 this acceptance is zero. A zero-proposal pair is never drawn and can be assigned any harmless acceptance value. Set K_xy=q_xy alpha(x,y) off the diagonal and K_xx=1-sum_(y different from x)K_xy, including rejected proposals and proposed self moves. Each accepted off-diagonal probability lies between zero and q_xy, so the diagonal is nonnegative and K is stochastic. The pairwise target flow is pi_x K_xy=min(pi_x q_xy,pi_y q_yx)=pi_y K_yx. Summing over x, including the diagonal flow, proves pi K=pi. Multiplying all target weights by the same positive normalizer cancels from alpha.

The same argument works for a proposal density q(y|x) with respect to a common base measure and target density p positive on the declared support S, normalized by a finite positive integral. Define the accepted flow density min(p(x)q(y|x),p(y)q(x|y)); on forward-positive, reverse-zero pairs rejection is certain. All proposals outside S are rejected. The leftover mass at x is a point mass at x, even when the original proposal has a continuous density, so the full transition kernel generally has both a density part and a rejection atom. The accepted double integral is symmetric in x,y. Integrating that identity against any bounded test function, and adding the diagonal rejection mass, proves that integration against p is unchanged by the complete kernel. Undefined zero-over-zero ratios are avoided by defining the accepted flow first on its actual support.

On a finite support, irreducibility requires the graph of positive accepted off-diagonal moves to connect all states in the directed path sense. Because a positive target makes each accepted edge bidirectional, connectivity of that actual bidirectional graph is sufficient and necessary. Connectivity of the forward proposal graph alone is insufficient if reverse probabilities vanish. For an irreducible finite accepted chain, a positive self-loop at at least one state is sufficient for aperiodicity: that state has a return of length one, and communicating states share its period. Such a self-loop may arise from rejection or a proposed self transition, but is not guaranteed. For example, a two-state uniform target with a proposal that always swaps states accepts every move and alternates forever. It is invariant and irreducible, yet periodic.

Detailed balance proves the target is invariant for the fixed declared proposal and acceptance rule; it gives neither a useful mixing-time bound nor independent observations. A proposal can be so local or so frequently rejected that finite-run bias and covariance remain large. A disconnected accepted graph can preserve pi while preventing movement between its classes, and an empirical histogram from one class cannot diagnose the missing mass. If a proposal is adapted from past output, one must establish a separate valid adaptive-process argument; the fixed-kernel calculation cannot simply be asserted conditionally for an arbitrary state-selected update. Exact arithmetic also belongs to the mathematical statement: clipping an invalid ratio or changing support through numerical underflow changes the kernel unless separately controlled. Related reading: [Constructing a stationary target with Metropolis transitions](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf), [Volume-preserving Hamiltonian proposals](https://arxiv.org/pdf/1206.1901v1). Symmetric accepted pair flow gives invariance, including rejected diagonal mass. The reverse-zero case has zero accepted flow where needed. The selected Metropolis and Hamiltonian sources give context for the finite and density arguments, with convergence claims kept separate.

28

Hamiltonian proposals with an exact acceptance correction

Let x belong to R^d, let V be C2 everywhere, assume Z=integral exp(-V(x)) dx is finite and positive, and let M be a fixed symmetric positive-definite mass matrix. Introduce momentum p with independent centered normal law of covariance M, and Hamiltonian H(x,p)=V(x)+(1/2)p transpose M^(-1)p. The joint target density rho is proportional to exp(-H). One leapfrog step L_h consists of a half kick p<-p-(h/2) grad V(x), a drift x<-x+h M^(-1)p, and another half kick using the new x. Each kick is a globally invertible shear with inverse of opposite step and block triangular Jacobian of determinant one; the drift has the same properties. Hence their composition is a global C1 bijection with absolute Jacobian determinant one. This remains a statement about a fixed finite step count and finite step size, not an assumption that a numerical trajectory conserves H.

Let R(x,p)=(x,-p). Momentum reflection conjugates each kick or drift at step h to the corresponding shear at step -h. The symmetric kick-drift-kick order therefore gives R L_h R=L_h^(-1). For any fixed integer L>=0, define T=R composed with L_h^L. Then T squared=R L_h^L R L_h^L=identity, and its absolute Jacobian determinant is one. The reflection has determinant with absolute value one as well. These identities give an involution on the full phase space without requiring a globally existing exact Hamiltonian differential-equation flow. When h=0 or L=0 the same identities hold directly. An unreflected leapfrog map is reversible through R, but is not itself generally the involution used in this acceptance proof.

For a current phase point z propose Tz and accept with a(z)=min(1,exp(H(z)-H(Tz))); otherwise retain z. Since T is an involution and preserves volume, rho(z)a(z)=min(rho(z),rho(Tz)) is symmetric under replacing z by Tz. To verify invariance explicitly, integrate the accepted contribution rho(z)a(z) phi(Tz) over z, substitute w=Tz with unit absolute Jacobian, and obtain integral rho(w)a(w) phi(w). Adding the rejection contribution integral rho(w)(1-a(w)) phi(w) leaves integral rho(w) phi(w). The result applies to bounded test functions and hence to the joint probability law. The finite normalizing constants cancel from the ratio. Exact energy conservation would make every proposal accepted, but the correction above is what makes a finite-step leapfrog proposal exact for its invariant law.

Replacing the momentum by a new independent N(0,M) draw leaves the product target rho unchanged: its x marginal stays exp(-V)/Z and its conditional momentum law is restored exactly. Composing this refresh with the accepted involution therefore also preserves rho, and discarding momentum yields a position transition preserving the desired x law. Fixed mixtures over step sizes or step counts chosen independently of the current phase point preserve invariance by averaging invariant kernels. Arbitrary state-dependent tuning, reflections at undeclared constraints, approximate gradients or a position-dependent mass require a new proposal/Jacobian argument and are outside this proof. Even the exact invariant construction does not establish irreducibility, rapid exploration, a central limit or a good acceptance rate; those depend on the potential and the actual tuning. Related reading: [Volume-preserving Hamiltonian proposals](https://arxiv.org/pdf/1206.1901v1). The kick, drift and kick are invertible volume-preserving shears. Momentum reflection turns the palindromic integrator into an involution, which gives exact detailed balance after acceptance. The source's small-cell explanation is supplemented by the full measurable change-of-variables argument.

29

Burn-in bias from a whole-kernel certificate

Let K be a stochastic matrix on a finite set, with invariant probability pi, and let alpha=max_(x,y) TV(K(x,.),K(y,.))<1 be its actual whole-kernel Dobrushin coefficient. For any two probability rows mu,nu, write their difference as t(mu_plus-mu_minus), where t=TV(mu,nu) and mu_plus,mu_minus are probability rows formed by normalizing the positive and negative parts; t=0 is immediate. Convexity of total variation gives TV(mu_plus K,mu_minus K)<=sum_(x,y)mu_plus(x)mu_minus(y) TV(K(x,.),K(y,.))<=alpha. Thus TV(mu K,nu K)<=alpha TV(mu,nu). Iterating against the actual invariant row yields TV(mu K^t,pi)<=alpha^t TV(mu,pi) for integer t>=0. An observed near match of a few rows is not this maximum-over-all-rows certificate.

For a real observable f with finite range R=max f-min f, subtract its minimum and use the positive/negative-part representation again: |mu f-nu f|<=R TV(mu,nu). Start X0 with the declared law mu, discard b>=0 transitions, and average the next n>=1 states A=(1/n)sum_(j=1)^n f(X_(b+j)). With d0=TV(mu,pi), linearity and the contraction bound give |E A-pi f|<=(R d0/n)sum_(j=1)^n alpha^(b+j). For 0<alpha<1 this is R d0 alpha^(b+1)(1-alpha^n)/(n(1-alpha)). The first retained time is explicitly b+1; an average including X_b has a different leading power. The bound d0<=1 is available when the initial distance is unknown, but does not certify any smaller initial distance.

If alpha=0, all rows of K are identical. Invariance makes that common row pi, so every state at a positive time has exactly law pi regardless of the start, and the displayed retained-mean bias is zero. No ambiguous zero-to-zero power is needed because b+j>=1. If f is constant then R=0 and the bias is zero for every kernel. If mu=pi it is zero for every b by stationarity. At alpha=1, the strict-contraction premise fails; the finite sum gives only the nondecaying trivial bound R d0 and no claimed geometric burn-in conclusion. A block certificate alpha(K^m)<1 instead gives TV(mu K^t,pi)<=alpha(K^m)^floor(t/m) d0, by applying the block contraction and the nonexpansion of the remainder kernel. Its bias bound is the actual sum of those integer-time terms.

Burn-in controls the marginal bias only when such a mathematical certificate or another valid mixing argument is available. The kept states still use successive applications of K and generally retain covariance even after stationarity is reached. A long trace, a stable-looking running mean or one empirical autocorrelation estimate supplies no whole-kernel contraction proof. Moreover a common invariant law is an explicit input, not a consequence of merely observing loss of initial memory in changing kernels. State-dependent tuning or an unknown invariant target requires its own argument. Sampling variance, initialization bias and computational cost therefore remain separate terms when assessing the accuracy of an actual Markov-chain estimator. Related reading: [Total variation, common mass and geometric convergence](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf). The maximum row-to-row total variation coefficient controls zero-mass signed measures. Compare the initial measure with the invariant target, then bound observable bias by its range. Strictness, alpha=0, index zero and repeated-chain dependence are explicit.

30

Correlation changes Monte Carlo precision

Let X start with a stationary law pi for a finite reversible kernel K. Restrict to states with pi_x>0; stationarity makes this support closed. The weighted inner product is <u,v>_pi=sum_x pi_x u_x v_x. Detailed balance makes K self-adjoint there, so an orthonormal eigenbasis exists with real eigenvalues in [-1,1]; the latter bound follows from Jensen, ||Ku||_pi squared<=sum_x pi_x sum_y K_xy u_y squared=||u||_pi squared. Put g=f-pi f and expand g=sum_j a_j e_j, allowing any eigenvalue-one directions orthogonal to the global constant when the support has several closed classes. Conditional expectation gives Cov(g(X0),g(Xk))=<g,K^k g>_pi=sum_j a_j squared lambda_j^k. With gamma_k denoting this covariance, direct expansion of the double sum proves Var(A_n)=[n gamma0+2 sum_(k=1)^(n-1)(n-k)gamma_k]/n squared.

Suppose every positive-mass closed class is aperiodic. All eigenvalues other than those equal to one then have absolute value less than one. To justify the endpoint exclusion, equality in the contraction/Jensen bound at modulus one forces an eigenfunction to transform with the same sign along every positive edge; a minus-one mode would make every return to its nonzero support have even length, contradicting period one. Let B=sum_(lambda_j=1)a_j squared. Eigenvalue-one terms contribute exactly B to Var(A_n). For a mode |lambda|<1, dominated summation of (1-k/n) lambda^k gives n times its variance contribution tending to a_j squared [1+2 lambda/(1-lambda)]=a_j squared (1+lambda)/(1-lambda). Hence, if B=0, the asymptotic variance v=lim n Var(A_n) is the finite sum over those modes. If B>0, n Var(A_n) tends to infinity and Var(A_n) tends to B: a random stationary class mean is not averaged away. In the usual irreducible case eigenvalue one is only the constant, g is orthogonal to it and B=0 automatically. Without irreducibility or classwise centering a finite variance-limit claim would be false.

For gamma0>0 define the exact finite-n correlation factor tau_n=1+2 sum_(k=1)^(n-1)(1-k/n)gamma_k/gamma0. Then Var(A_n)=gamma0 tau_n/n. Whenever the variance is positive, n_eff,n=n/tau_n is the number of independent draws of variance gamma0 giving that same variance. In the finite-limit case with v>0, tau_n tends to tau=v/gamma0 and the asymptotic comparison is n_eff approximately n gamma0/v. A negative eigenvalue has factor (1+lambda)/(1-lambda)<1, so a pure negatively correlated mode can yield n_eff greater than n. This is a variance comparison for the declared observable, not an actual count of independent states. If f is constant, gamma0=0 and the estimator is exact; the ratio definition is left undefined. A reducible B>0 case instead has bounded limiting effective size gamma0/B despite n increasing.

Signed covariance terms determine the variance at finite nPositive persistence inflates averaging noise; Every nonzero lag is weighted by the exact number of ordered pairs. The finite variance is 89/200 compared with the independent benchmark 1/5.Signed covariance terms determine the variance at finite nLag 05Lag 14Lag 23/2Lag 31/2Lag 41/805Contribution to n² Var(mean)
Every nonzero lag is weighted by the exact number of ordered pairs. The finite variance is 89/200 compared with the independent benchmark 1/5.

A stationary ±1 chain has unit variance and lag covariance ρ^h under the stated conditional mean. Expand the variance of the sample sum into all ordered pairs and then divide by n². The long-run factor follows from the geometric covariance series.

Exact finite and long-run variance checks
QuantityExact result
Finite average variance89/200
Independent benchmark1/5
n × finite average variance89/40
Long-run n × variance limit3
Autocovariance at lag hρ^h
Exact inputs and supporting calculations
Declared inputs
ParameterValue
rho1/2
n5

The derivation assumes the chain is actually stationary and the kernel and target satisfy the stated finite reversible spectral premises. At a periodic minus-one mode, the absolutely summable covariance argument and positive finite v need their own endpoint treatment; aperiodicity here explicitly excludes it. A small empirical autocorrelation sum can omit slow modes or be strongly biased by limited data. It therefore supplies no proof of the population covariance, no removal of initialization bias and no automatic central-limit theorem. Weight effective sample size, (sum w) squared/sum w squared, depends on unequal weights rather than serial covariance and is a different object. The next return-cycle argument proves a genuine central limit under its own finite irreducibility premises instead of calling this second-moment limit a distributional result. Related reading: [Weighted symmetry and absolute spectral rates](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf), [Dependence and the variance of a time average](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf). Use the stationary chain and its weighted symmetric kernel. The exact sum includes invariant nonconstant modes in the reducible case. A positive projection onto such a mode prevents 1/n scaling, so the finite integrated correlation and ESS formulas are used only in their stated domain.

31

A regenerative Markov-chain central limit

Let K be finite irreducible, choose a state a and put g=f-pi f for bounded f, where pi is the unique stationary law. Positive finite paths to a give integers m0>=1 and epsilon>0 such that the first hit of a from any state has tail bounded by (1-epsilon)^floor(t/m0), up to a fixed initial block; a positive return from a has the same type of bound by applying this after its first step. The Markov property on disjoint stopped-history events yields the strong Markov property, so successive complete return cycles to a have iid pairs (T_j,R_j), with T_j their positive integer length and R_j=sum of g along the cycle before its endpoint. The geometric tail gives finite moments of every order for T_j, and |R_j|<=||g||_infinity T_j. To verify E R_j=0, let q_x be the expected number of visits to x before the next return, starting at a. Summing the one-step transition law over the cycle gives (qK)_y-q_y=E[1_(X_T=y)-1_(X_0=y)]=0. Thus q/(sum_x q_x) is stationary; uniqueness makes it pi. With m=E T_j=sum_x q_x, we obtain E R_j=sum_x q_x g_x=m pi g=0. This proves the centering instead of presuming it.

Let H be the first hit of a from an arbitrary initial law, and form return cycles after H. The finite initial reward is negligible divided by square root n because H has a uniform geometric tail. The iid finite-variance strong law applied to lengths gives (T1+...+Tk)/k tending to m almost surely. Inverting these strictly increasing partial sums proves N(n)/n tends to 1/m almost surely, where N(n) counts completed cycles by time n after H. The unfinished final reward has absolute value at most ||g||_infinity T_(N(n)+1). Since cycle lengths are at least one, no more than n+1 such lengths need inspection by time n. A union bound gives P(max_(j<=n+1)T_j>eta square root n)<=C(n+1) rho^(c eta square root n), tending to zero for each eta>0 and some rho<1. The same geometric bound handles H. Consequently the total sum S_n=sum_(t=0)^(n-1)g(X_t) differs from sum_(j=1)^N(n)R_j by o_probability(square root n).

It remains to replace the random cycle count without falsely making it independent of its rewards. Put k_n=floor(n/m). For any fixed delta>0, N(n)/n tending to 1/m implies P(|N(n)-k_n|>delta n) tends to zero. On the complementary event, the difference between the reward sums at these two indices is bounded by the maxima of centered partial sums in the forward or backward windows of at most ceil(delta n) iid rewards adjacent to k_n. The maximal second-moment inequality follows by splitting the first crossing of a threshold, using independent mean-zero future increments and expanding the square; it bounds each window-crossing probability by ceil(delta n) E R1 squared/(eta squared n). Taking n to infinity then delta down to zero makes the difference negligible divided by square root n. No independence of N(n) and R_j was used. The iid central limit for the deterministic k_n sum now gives S_n/square root n converging in distribution to N(0,E R1 squared/m). If E R1 squared=0, every complete centered cycle reward is zero almost surely, and the already controlled prefix/residual prove the degenerate limit directly. Periodicity does not invalidate this return-cycle proof.

In a stationary finite irreducible aperiodic reversible case this cycle variance agrees with the spectral variance already derived, but distributional convergence alone would not justify equating second moments. For completeness solve (I-K)h=g on the pi-centered finite space, where invertibility follows because the eigenvalue-one eigenspace is only the constants. Then S_n=h(X0)-h(Xn)+M_n, with martingale increments D_(t+1)=h(X_(t+1))-(Kh)(X_t), bounded by a fixed D and conditionally centered. Orthogonality gives E M_n squared<=n D squared. Expanding (M_t+D_(t+1)) to the fourth power and taking conditional expectations removes the cubic-in-M term; the remaining new terms are bounded by 6D squared E M_t squared+4D cubed E|M_t|+D to the fourth. Cauchy-Schwarz and summation give E M_n to the fourth=O(n squared); the bounded endpoint then gives E S_n to the fourth=O(n squared). Thus S_n squared/n is uniformly integrable, since its tail expectation beyond K is at most sup E(S_n to the fourth/n squared)/K. Truncating the square, using the normal limit and then this bound proves convergence of second moments to E R1 squared/m. This identifies the stationary variance limit without importing an unproved martingale central-limit theorem. Related reading: [Regenerative cycle rewards and residuals](https://www.columbia.edu/~ww2040/clt2.pdf), [Time averages without an aperiodicity assumption](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf), [Dependence and the variance of a time average](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf). Regenerative return lengths and rewards have the stated finite moments. Their iid sum, random time index and residual are controlled separately, including an initial delay and zero cycle variance. The source supplies the cumulative-process framework and the Markov source supplies covariance context. The lesson establishes the return-cycle limit for its own hypotheses.

32

Independent replicas and honest error bars

Fix a complete finite simulation protocol before comparing replicas: its initial law, burn-in, kept length, tuning choices and reported scalar are part of the protocol. Run it with independent copies of all its random inputs to obtain Y1,...,YR. Measurable functions of these independent equal-law input blocks are iid, even if a single output averages highly dependent chain states or uses internal adaptive choices. Write mu_proc=E Y1 and sigma_proc squared=Var(Y1), assumed finite. Independence across complete replicas gives E Ybar=mu_proc and Var(Ybar)=sigma_proc squared/R. Independent random seeds are a mathematical independence assumption here; a collection of arbitrary deterministic pseudorandom seeds is not its proof. Different run lengths or data-selected protocols generally give different output laws and do not enter this iid identity unchanged.

For R>=2, let s_R squared=(1/(R-1))sum_r(Y_r-Ybar) squared. The identity sum(Y_r-Ybar) squared=sum(Y_r-mu_proc) squared-R(Ybar-mu_proc) squared gives E s_R squared=sigma_proc squared by the just-derived variance. Under E|Y1| to the fourth<infinity, apply the finite-variance strong law both to Y_r-mu_proc and to (Y_r-mu_proc) squared; their sample means tend almost surely to zero and sigma_proc squared respectively. The same centered-square identity then gives s_R squared tending almost surely to sigma_proc squared. Bounded f and a fixed finite average ensure this fourth-moment premise automatically, while a general unbounded simulation output needs it checked rather than inferred from a finite record.

If sigma_proc squared>0, the iid finite-variance central limit gives square root R (Ybar-mu_proc)/sigma_proc tending to a standard normal. Consistency of s_R and the standard tightness-and-ratio argument replace sigma_proc by s_R without changing the limiting distribution: the difference of the two standardized expressions is a tight numerator times a multiplier tending to zero in probability. Thus Ybar plus or minus a chosen normal quantile times s_R/square root R is an asymptotic interval for mu_proc. It is not an exact finite-R normal or Student interval for arbitrary replicate outputs. If sigma_proc squared=0, each output equals mu_proc almost surely and the sampling uncertainty is zero, though a repeated observed constant in finitely many outputs does not establish this population premise.

The desired target mu may differ from mu_proc because of initialization, finite resolution, truncation or another fixed-protocol approximation. The error decomposes exactly as Ybar-mu=(Ybar-mu_proc)+(mu_proc-mu). Increasing R shrinks only the first term. If an independently established deterministic bound |mu_proc-mu|<=B is available, enlarge an interval covering mu_proc by B at both ends to cover mu with at least the same coverage. In particular an asymptotic normal interval remains asymptotic after this enlargement; it does not become an exact certificate. Treating all states inside all runs as iid, or claiming that agreement among replicas proves negligible target bias, would invalidate the uncertainty interpretation even when the replicas themselves are independent. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf), [Dependence and the variance of a time average](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf), [Regenerative cycle rewards and residuals](https://www.columbia.edu/~ww2040/clt2.pdf). Independent replicas are iid outputs of a fixed simulation procedure. Within-run dependence and fixed initial-law bias remain in their respective places. A variance estimate across replicas and any normal approximation concern the procedure's mean.

33

Sequential importance weights on complete paths

Fix a finite time horizon T and finite state spaces. Let nonnegative target factors h0(x0) and h_t(x_(t-1),x_t), t=1,...,T, define gamma_t(x0:t)=h0(x0) product_(s=1)^t h_s(x_(s-1),x_s). The unnormalized path integral is Gamma_t(phi)=sum_(x0:t)gamma_t(x0:t) phi(x0:t), and its mass is Z_t=Gamma_t(1). A proposal first draws X0 with law q0 and then draws X_t with the actual conditional probability q_t(.|X0:t-1), which may depend on the full past but not the unseen future. For the recursion at every t require positive proposal probability on every gamma_t-positive prefix. Target-positive full paths must therefore be reachable. On a drawn path with positive proposal probabilities define W_t=[h0(X0)/q0(X0)] product_(s=1)^t [h_s(X_(s-1),X_s)/q_s(X_s|X0:s-1)]. A zero target prefix sets all later W to zero; the proposal may continue by any declared conditional law and no zero-over-zero calculation is needed.

At t=0 summing q0(x0)[h0(x0)/q0(x0)] phi(x0) gives Gamma0(phi), with zero-target terms contributing zero. Conditionally on the observed prefix at t-1, summing over the next proposal state gives E[W_t phi(X0:t)|X0:t-1]=W_(t-1) sum_x h_t(X_(t-1),x) phi(X0:t-1,x), since proposal probabilities cancel wherever the target can contribute. Applying the preceding-stage identity to this complete prefix function yields E[W_t phi(X0:t)]=Gamma_t(phi) by induction. Equivalently the full proposal path probability is q0 product_s q_s, whose direct product with W_t equals gamma_t on target-positive paths. The direct terminal sum needs only domination of target-positive terminal paths; claiming all intermediate-prefix identities additionally needs the prefix support condition used in the induction. Finite nonnegative factors avoid integrability ambiguity here; signed phi is harmless on the finite path set.

With n independent complete proposal paths, the average of W_T phi is therefore unbiased for Gamma_T(phi), and the average of W_T is unbiased for Z_T. If Z_T>0, the normalized target expectation is mu=Gamma_T(phi)/Z_T, but replacing numerator and denominator by these two averages creates a ratio. It is not generally unbiased. Already at T=0, take two states with q0=(1/2,1/2), h0=(1,3) and phi=(0,1). The target mean is 3/4. For n=1, normalized weighting cancels its sole positive weight and reports phi(X0), whose expectation is 1/2. Under iid repetitions finite-support positive-mass weights have ordinary strong laws, so both averages converge to their target sums and the ratio converges to mu when its denominator is eventually positive. Consistency does not erase the finite-n bias just exhibited.

If the total weight in a finite realized set of paths is zero, its normalized estimate is undefined, even when the true Z_T is positive. Report that event rather than silently replacing the denominator or resampling until a pleasing answer appears. If Z_T=0, no normalized target probability exists at all, although the unnormalized zero-integral identity remains meaningful. Sequentially updated weights on one path still encode the complete proposal-to-target product; dropping factors or using a proposed rather than actual conditional proposal changes the expectation. Particle resampling introduces dependence across paths and needs its own unnormalized-measure induction, given next. Neither this finite-path support proof nor an unequal-weight effective size proves that a practical path proposal explores rare regions efficiently. Related reading: [Importance weighting and defensive mixture sampling](https://www.stat.cmu.edu/technometrics/90-00/vol-37-02/v3702185.pdf), [Feynman–Kac measures and particle resampling](https://www.stats.ox.ac.uk/~doucet/delmoral_doucet_jasra_adaptiveresamplingSMC.pdf). The target path product is absolutely continuous on prefixes that can contribute positive mass. Using each step's actual conditional proposal gives exact unnormalized integration. Zero-weight prefixes and normalization use separate conventions.

34

Resampling and an unbiased particle normalizer

Let the finite-state model start with law mu, use transition matrices M_t and nonnegative bounded potentials G_t, t=0,...,T. Define gamma0(f)=mu(G0 f), gamma_t(f)=gamma_(t-1)(M_t(G_t f)) and Z_t=gamma_t(1). This is an unnormalized Feynman-Kac recursion, so no positivity of every individual potential is presumed. Draw N>=1 initial particles independently from mu and let eta0^N be their empirical law. Put Zhat0=eta0^N(G0). When it is positive, the weighted empirical law is nu0^N(f)=eta0^N(G0 f)/eta0^N(G0); its unnormalized version is gammahat0(f)=Zhat0 nu0^N(f)=eta0^N(G0 f). If all weights vanish, define gammahat0 and Zhat0 as zero and mark extinction instead of forming a ratio. Initial independence gives E gammahat0(f)=gamma0(f).

At a positive-weight stage t-1, resample each ancestor independently from the exact weighted law nu_(t-1)^N, then independently propagate it with M_t. Conditionally on the previous particles, each new particle has law nu_(t-1)^N M_t. Let eta_t^N be their new empirical law, set Zhat_t=Zhat_(t-1) eta_t^N(G_t), and, when positive, normalize nu_t^N(f)=eta_t^N(G_t f)/eta_t^N(G_t). The unnormalized estimator is gammahat_t(f)=Zhat_(t-1) eta_t^N(G_t f). Conditional expectation gives E[gammahat_t(f)|past]=Zhat_(t-1)nu_(t-1)^N M_t(G_t f)=gammahat_(t-1)(M_t(G_t f)). Taking expectations and applying the previous-stage identity proves E gammahat_t(f)=gamma_t(f) by induction. In particular E Zhat_t=Z_t; the product normalizer, although built from dependent random stages, is unbiased.

If an empirical potential average becomes zero, every one of its nonnegative weighted terms is zero. Set Zhat and gammahat to zero at that stage and all later stages. Subsequent particles may be assigned an arbitrary declared law, since their prefactor is zero, or the extinct run may stop; it must not be discarded and retried without changing the procedure. If extinction occurred before the current step, the previous unnormalized measure is zero and both sides of the conditional identity are zero. At the first newly zero empirical potential average, the realized current estimator is zero, while its expectation conditional on the preceding positive-weight past is still given by the full conditional identity and need not be zero. Thus the same induction covers both cases. Bounded potentials and finite horizon make the needed expectations finite. The proof uses the actual conditional resampling and propagation probabilities, not a heuristic assertion that the particles are independent unconditionally. Other unbiased resampling schemes need their own conditional empirical-mean identity before the same induction can be used.

Unbiased gammahat and Zhat do not make nu_t^N=gammahat_t/Zhat_t unbiased for the normalized posterior. Take N=1 on states 0,1, initial probabilities (1/2,1/2), identity propagation, G0=(1,3) and G1=(2,1). The one-particle normalizer is 2 or 3 with equal probability, so its mean is 5/2, the true Z1. The true final state-1 probability is (3/2)/(5/2)=3/5. But the single particle keeps its initial state, and its reported state-1 indicator has mean 1/2. Thus the finite normalized posterior is biased despite a correct unbiased normalizer and no extinction. An unequal-weight effective size may trigger resampling, but does not prove accuracy of that posterior or independence of its ancestors. Related reading: [Feynman–Kac measures and particle resampling](https://www.stats.ox.ac.uk/~doucet/delmoral_doucet_jasra_adaptiveresamplingSMC.pdf). Conditional iid resampling and transition give the expected next unnormalized empirical measure. The retained preprint's predictive and updated notation is reconciled explicitly. The lesson includes nonconstant initial potential, zero-weight extinction and the normalizer induction.

35

Multilevel coupling and its complete work bound

Let P_l be a hierarchy of integrable approximations with target limit mu, and choose a finite terminal level L. Couple P_l and P_(l-1) within each level and set Y0=P0, Y_l=P_l-P_(l-1) for l>=1. Use N_l>=1 iid copies of Y_l at level l, independently across different levels; within each difference the declared coupling is retained. With V_l=Var(Y_l)<infinity and positive expected cost C_l per copy, the estimator I=sum_(l=0)^L average(Y_l) has E I=E P_L by telescoping and Var(I)=sum_l V_l/N_l by independence. Its mean squared error for mu is exactly (E P_L-mu) squared+sum_l V_l/N_l. A strong coupling can reduce V_l even when Var(P_l) stays large. Reusing dependent level averages would add cross-level covariances and is outside this allocation identity.

Suppose the chosen L has absolute bias at most epsilon/square root 2, and write A=sum_(l=0)^L square root(V_l C_l). Cauchy-Schwarz applied to square root(V_l/N_l) and square root(N_l C_l) gives A squared<=Var(I) times expected work. For A>0, the continuous allocation N_l*=2 epsilon^(-2) A square root(V_l/C_l) on positive-variance levels attains variance epsilon squared/2 and work 2 epsilon^(-2) A squared. The implementable counts N_l=max(1,ceil(N_l*)) have no larger variance and expected work at most 2 epsilon^(-2) A squared+sum_l C_l, since max(1,ceil(x))<=x+1 for x>=0. A zero-variance level still needs one evaluation unless its constant value is already known. If every variance is zero, A=0, one evaluation per unknown constant level gives zero sampling variance directly. These cases avoid division by a zero allocation.

For geometric rates assume positive alpha,beta,gamma and constants with |E P_L-mu|<=c_B 2^(-alpha L), V_l<=c_V 2^(-beta l), C_l<=c_C 2^(gamma l). For c_B>0 choose L=max(0,ceil(log2(square root 2 c_B/epsilon)/alpha)); then 2^L=O(epsilon^(-1/alpha)) as epsilon decreases. The sum A is bounded by a constant times sum_(l=0)^L 2^((gamma-beta)l/2), while the ceiling work sum_l C_l is O(2^(gamma L)). Therefore the total sufficient work is O(epsilon^(-2)+epsilon^(-gamma/alpha)) when beta>gamma; O(epsilon^(-2)(1+log(1/epsilon)) squared+epsilon^(-gamma/alpha)) when beta=gamma; and O(epsilon^(-2-(gamma-beta)/alpha)+epsilon^(-gamma/alpha)) when beta<gamma. Each statement retains the cost of at least one finest-level draw. If c_B=0 the hierarchy bias is already zero and L can be fixed; a constant-cost-per-level model gamma=0 instead retains its actual L+1 ceiling term.

The commonly quoted shorter complexity cases require conditions ensuring the finest-level/ceiling term is no larger than the variance-allocation term. Dropping it without such a condition can falsely predict less work than one necessary fine simulation. The rates above also require actual bounds on bias, coupled variance and expected sample cost, not an extrapolation from a few observed levels. A pilot may estimate promising allocations, but independent validation or an appropriate conditional argument must justify the accuracy claimed after selection. No allocation repairs an incorrectly coupled difference, an omitted hierarchy bias or dependence between averages that was not included in the variance. The work calculation is an expectation for declared fixed counts; a random stopping budget needs a separate analysis. Related reading: [Coupled level corrections and multilevel complexity](https://people.maths.ox.ac.uk/~gilesm/files/acta15.pdf). The mean telescopes across coupled level differences, with independent level groups for variance. Cauchy–Schwarz shows the continuous allocation and adding at most one sample per active level accounts for ceilings. Simplifying the geometric regimes requires the extra exponent condition stated in the source.

36

Differentiating a Monte Carlo expectation

For a common-input path derivative, let Z have a probability law independent of the scalar parameter theta and write mu(theta)=E F(theta,Z). In one fixed neighborhood of theta0 assume that for almost every Z the map theta->F(theta,Z) is differentiable throughout that neighborhood, its derivative is bounded there in absolute value by one integrable random variable H(Z), and one reference value is integrable. The mean value theorem bounds each difference quotient by H. Dominated convergence therefore proves mu_prime(theta0)=E partial_theta F(theta0,Z). Averaging independent path derivatives is unbiased for this derivative; a variance or normal-error formula additionally requires its second moment. A differentiable simulator map alone is insufficient if the payoff composition is not differentiable or no integrable domination survives the parameter change.

For the score alternative, let p_theta be normalized densities on one fixed support S with respect to a fixed base measure. Assume p_theta>0 there near theta0, that for almost every x the density is differentiable in theta throughout one fixed neighborhood, and that integrable bounds dominate both |partial_theta p_theta| and |g partial_theta p_theta| throughout that neighborhood. For a theta-independent integrable payoff g, differentiation under the integral gives mu_prime=integral g partial_theta p=E[g(X)s(X)], with s=partial_theta log p at theta0. Applying the same domination to normalization gives E s=integral partial_theta p=0. Hence E[(g(X)-b)s(X)]=mu_prime for any fixed scalar b. A coefficient trained independently may be conditioned on and used as a constant; an arbitrary sample-dependent b(X) has no such zero-mean guarantee. If g itself depends smoothly on theta, its dominated partial derivative contributes E partial_theta g as a separate term.

Moving support can invalidate the score calculation even for a harmless payoff. If X is uniform on (0,theta), the interior score is -1/theta. For g=1 it would give -1/theta, whereas E1=1 has derivative zero. For g=X it gives -1/2, whereas E X=theta/2 has derivative 1/2. The missing moving-endpoint term is exactly why the fixed-support differentiation proof does not apply. Similarly, for Z uniform on (-1,1) and F(theta,Z)=1_(Z<=theta), the pathwise derivative is zero almost surely at any interior theta, yet E F=(theta+1)/2 has derivative 1/2. Discontinuous threshold paths do not satisfy the asserted dominated differentiable-payoff premise, so averaging their zero path derivatives gives the wrong sensitivity.

When the common-input derivative assumptions do hold, the same difference-quotient domination also explains variance control for a finite difference: |F(theta+h,Z)-F(theta,Z)|/|h|<=H(Z), so E H squared<infinity bounds its second moment uniformly over allowed h. Its expectation is still a finite difference, with a separate truncation bias relative to mu_prime; higher-order smoothness is needed to bound that bias at a stated rate. A score estimator, pathwise derivative and finite difference may all estimate the same sensitivity under different valid hypotheses, yet have very different variances and costs. Singular support changes, nonintegrable scores or numerical differentiation errors must be resolved explicitly rather than hidden by a small observed sample variance. Related reading: [Likelihood ratios and differentiation of expectations](https://arxiv.org/pdf/1707.02659), [Shared inputs and conditional estimators](https://artowen.su.domains/mc/Ch-var-basic.pdf). Domination on a common differentiability neighborhood justifies the pathwise difference quotient, and a fixed dominating measure and support justify the score argument. The constant baseline uses the zero expectation of the score. The source's steady-state limit needs further conditions outside this claim.

37

Removing truncation bias by randomization

Let integrable Y0 and increments Delta_l, l>=1, satisfy sum_l E|Delta_l|<infinity, with mu=E Y0+sum_l E Delta_l. This is the expectation of a telescoping limit whenever the corresponding approximation expectations converge to that value. Independently of all Y0 and increments draw a nonnegative integer T, finite almost surely, with survival probabilities p_l=P(T>=l)>0. Define Z=Y0+sum_(l=1)^T Delta_l/p_l. Independence gives E[|Delta_l|1_(T>=l)/p_l]=E|Delta_l|. Tonelli then proves the infinite absolute sum is integrable, and Fubini gives E Z=E Y0+sum_l E Delta_l=mu. Thus the survival weighting removes the deterministic truncation bias. Dependence among increments themselves is permitted; independence of T from the whole increment construction is the assumption that justifies these cancellations.

For a sufficient finite-second-moment condition suppose Y0 is in L2 and sum_l ||Delta_l||_2/square root(p_l)<infinity. The L2 norm of Delta_l 1_(T>=l)/p_l is exactly ||Delta_l||_2/square root(p_l), again by independence. Minkowski makes the finite partial sums Cauchy in L2 and bounds the limiting norm by ||Y0||_2 plus this series. Since T is finite almost surely, their pointwise limit is the actually implemented finite random sum Z, which therefore has finite second moment. This is a sufficient condition, not a necessary characterization of every specially correlated construction. The original absolute-expectation condition proves the mean without requiring an unjustified exchange of conditionally convergent signed terms.

If level l is computed only when T>=l and its nonnegative random extra cost C_l is generated independently of the decision T, its expected total work is E C0+sum_l p_l E C_l by Tonelli. Suppose ||Delta_l||_2<=c 2^(-beta l/2) and E C_l<=c_C 2^(gamma l), with positive beta and gamma. Choose p_l=2^(-r l), realized by the decreasing survival law of a finite geometric-tail T. The sufficient L2 series is bounded by c sum_l 2^(-(beta-r)l/2), finite for r<beta, while expected work is bounded by a geometric series in 2^(-(r-gamma)l), finite for r>gamma. Hence gamma<r<beta is an explicit sufficient window for both finite variance and finite expected work. It exists only when beta>gamma under these bounds; no guarantee is claimed at the equality endpoints.

An implementation may share fine/coarse random inputs to achieve the increment decay, but it must preserve the exact marginal expectations of those increments and the independence of the truncation decision. Choosing a stopping tail after inspecting an increment changes its survival probabilities conditionally and is not the independent proof above. A finite expected cost also allows an unbounded realized runtime; imposing an unaccounted hard cutoff reintroduces truncation bias. When the variance-work window is absent these sufficient bounds do not prove impossibility for every other method, yet they do rule out claiming efficiency from this argument. Unbiasedness, finite variance and affordable expected work are three separate properties, all of which need evidence for an actual hierarchy. Related reading: [Survival weights for randomized truncation](https://arxiv.org/pdf/1207.2452). The preprint illustrates independent truncation and reweighting. The lesson proves Tonelli/Fubini for the mean and Minkowski sufficient conditions for L² under distinct work and survival exponents. Its calculation does not use the printed step from a second-moment rate to a power-2r moment.

38

An error guarantee that survives repeated inspection

Let Y_i be iid with one fixed mean mu and known deterministic bounds a<=Y_i<=b, and put R=b-a. If R=0, every observation and its mean equal a and use the exact singleton interval. For R>0 the previously derived bounded-observation exponential inequality gives P(|Ybar_n-mu|>=r)<=2 exp(-2n r squared/R squared) for every fixed positive integer n. Choose positive failure budgets alpha_n with sum_(n>=1)alpha_n<=alpha, where 0<alpha<1, and set r_n=R square root(log(2/alpha_n)/(2n)). Substitution makes each fixed-n failure probability at most alpha_n. The union bound over the countable set of all n then gives P(for every n>=1,|Ybar_n-mu|<=r_n)>=1-alpha, using an open/closed endpoint convention that only enlarges the interval.

A particularly transparent allocation is alpha_n=alpha/[n(n+1)], because 1/[n(n+1)]=1/n-1/(n+1) telescopes to total one. Its radius is R square root(log(2n(n+1)/alpha)/(2n)). Another conventional allocation is alpha_n=6 alpha/(pi squared n squared), using the known analysis identity sum_(n>=1)1/n squared=pi squared/6; it gives the same simultaneous argument with its corresponding explicit radius. These bounds are conservative compared with sharper confidence sequences, but their coverage follows from the stated finite-sample exponential inequality and a complete countable union, without a hidden fixed-time normal approximation. Clipping the interval to the known feasible mean range [a,b] preserves its coverage.

Let tau be any data-dependent positive integer stopping time which is finite almost surely. On the simultaneous event just proved, the inequality holds at every integer and therefore at tau, whatever the stopping rule has observed. Thus the reported interval at tau has coverage at least 1-alpha. No independence between tau and the observations is required for this event implication. If the procedure can run forever, the correct unconditional statement is P(tau<infinity and the reported interval misses mu)<=alpha; a conditional coverage statement given termination would require a separate calculation. Neither result makes Ybar_tau unbiased. Stopping when the radius first falls below a requested tolerance is allowed, as is using additional data-dependent criteria, provided the original simultaneous bounds and actual sampling law remain valid.

Repeatedly inspecting a fixed-sample normal interval is not this construction: its nominal error applies at one declared time under its assumptions, not to the union over an unbounded set of selected times. The known bounds a,b cannot be replaced silently by the smallest and largest observations seen so far, and serially dependent Markov states do not acquire the iid inequality by being averaged. Multiple observables, adaptive proposal changes or model selection require their own joint/conditional error accounting. If an estimate is centered at an approximate simulation mean, the confidence sequence covers that mean; separate model and numerical bias bounds are still required to cover the scientific target. The simultaneous event controls sampling error, not all sources of uncertainty. Related reading: [Nonnegative supermartingales and time-uniform bounds](https://arxiv.org/pdf/1808.03204v8). Positive summable failure budgets and a union bound make the fixed-time bounded-observation inequalities simultaneous. The displayed confidence sequence therefore covers every finite stopping rule at once. This narrower proof does not rely on the broader Ville construction.

39

Keeping the total scientific error budget

Let P be the scientific target probability and Q the declared simulation probability on the same measurable space. Let f be a bounded real observable with oscillation R_f=sup f-inf f, and let g be its implemented approximation with a proven uniform error |g-f|<=eta. Suppose the model discrepancy has a genuine total-variation bound TV(P,Q)<=delta, using TV=sup_A|P(A)-Q(A)|. Writing f=inf f+R_f h with 0<=h<=1, the layer-cake identity integral h dP-integral h dQ=integral_0^1[P(h>t)-Q(h>t)] dt gives |E_P f-E_Q f|<=R_f delta; if R_f=0 the result is direct. Also |E_Q g-E_Q f|<=eta. The triangle inequality therefore yields |E_Q g-E_P f|<=eta+R_f delta. A density ratio, shared support or an observed histogram is not needed for this mathematical bound, but an actual uniform error and actual model-distance certificate are needed.

If a sampling procedure gives an estimator Ihat and a valid event |Ihat-E_Q g|<=r with probability at least 1-alpha, the same event implies |Ihat-E_P f|<=r+eta+R_f delta. Here r may be deterministic or a data-dependent valid radius; its coverage must apply to the actual chosen estimator and time. If the available sampling event is instead centered on E Ihat and an independently proved finite-procedure bias bound |E Ihat-E_Q g|<=B_proc is known, the resulting total bound is r+B_proc+eta+R_f delta. This separates, for example, finite Markov initialization from the target-law discrepancy. At a random stopping time every bound used must be valid at that time, through a simultaneous statement or another legitimate argument; inserting a fixed-time radius after selection is insufficient.

The observable, eta, r, B_proc and R_f have the same physical units, while delta is dimensionless. Variance has squared observable units and cannot be added directly to an absolute error budget; its square-root uncertainty needs a justified probability conversion. Expected computational work, realized runtime and the probability of exceeding a budget are also separate quantities. Independent replicas can reduce random error without shrinking a fixed model discrepancy, and exact importance normalization or an invariant Markov kernel does not certify that the simulator represents the physical population. Numerical quadrature, time stepping, omitted rare events and model inputs must each be assigned their own justified approximation term rather than being relabeled as Monte Carlo noise.

Finite observed agreement cannot establish the uniform premises in this bound. For instance, let Q put all mass on an ordinary state where f=0, while P puts an additional mass delta on an unseen state where f=H. Every Q simulation reports zero, yet the target mean is delta H. With a known bounded range H the total-variation term accounts for that difference; without an observable-range or suitable moment control, arbitrarily large H makes a small total-variation distance insufficient to bound expectation error. Particle transport in physics, rare biological outcomes and resource-risk models therefore benefit from the same distinction: a valid stochastic estimator answers the declared model, and a scientific conclusion also needs evidence for how that model and its implemented observable approximate the target. No numerical pattern substitutes for those hypotheses. Related reading: [Variance reduction at a stated evaluation budget](https://artowen.su.domains/mc/Ch-var-basic.pdf), [Coupled level corrections and multilevel complexity](https://people.maths.ox.ac.uk/~gilesm/files/acta15.pdf), [Total variation, common mass and geometric convergence](https://pages.uoregon.edu/dlevin/MARKOV/mcmt2e.pdf). An actual uniform integrand discrepancy and an actual total variation discrepancy give separate deterministic terms using the declared range convention. A valid stochastic certificate for the sampled approximation accounts for the remaining term. Observed agreement and random work do not establish those premises.

Compare exact finite-sample Monte Carlo error and variance under different designs, keeping assumptions and invalid requests visible.

Zero events bound a probability without proving it zero

A positive event rate still permits zero observations

Zero successes leave an upper confidence limitA positive event rate still permits zero observations; The curve assumes the declared event rate. At the selected trial count, the zero-success outcome gives upper limit 0.1391083 by exact one-sided inversion. The lower panel resolves the neighboring counts 28 and 29. Only 29 and later counts satisfy the design threshold.Zero successes leave an upper confidence limit-0.03501.0350202932Zero-success probabilityDesign threshold αn=20Declared sample sizeTrial count · P(no successes) over the actual design range0.0360.0642728293031Zero-success probabilitiesExact α thresholdabove 1/20meets 1/20Last count above α and first count at or below αNeighboring integer trial counts · threshold detail
The curve assumes the declared event rate. At the selected trial count, the zero-success outcome gives upper limit 0.1391083 by exact one-sided inversion. The lower panel resolves the neighboring counts 28 and 29. Only 29 and later counts satisfy the design threshold.

The chance of zero successes is (1−p)^n under independence. Inverting the zero-count test gives the one-sided upper confidence limit. The design target uses a known hypothetical p and answers a different question from that confidence limit.

Exact zero-success and sample-size checks
QuantityExact result
P(0 successes at declared rate)(9/10)^20
Rounded zero-success probability0.1215767
Upper bound after observing zero1−(1/20)^(1/20)
Smallest count with probability ≤α29
Confidence level19/20
Exact previous trial comparison(9/10)^28 > 1/20
Exact qualifying comparison(9/10)^29 ≤ 1/20
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p1/10
n20
alpha1/20

Rare observations need proposal support, not just weights

A supported rare-event proposal eliminates variance when targeted

Proposal support comes before the variance comparisonA supported rare-event proposal eliminates variance when targeted; Signed importance values are 0 and 4/5. Only designs with the appropriate support enter the variance comparison. Upper panel compares signed quantities by outcome; lower panel compares only variances.Proposal support comes before the variance comparison-0.13600.9360102/5Target masses × signed rewards04/5Proposal-weighted observationsOutcome · target contribution and proposal-weighted observation-0.11501.72801236/254/250Valid variance at each designDesign: crude (0), declared (1), optimal (2) · variance
Signed importance values are 0 and 4/5. Only designs with the appropriate support enter the variance comparison. Upper panel compares signed quantities by outcome; lower panel compares only variances.

Each contribution is divided by the probability of sampling that outcome. Every nonzero target term needs positive proposal mass. The minimum second moment is the square of the sum of absolute target contributions, attained with proposal masses proportional to those absolute values.

Exact importance sampling values
QuantityExact result
Target expectation2/5
Target contributions by outcome(0, 2/5)
Proposal probabilities(1/2, 1/2)
Per-outcome importance values0 / 4/5
Crude variance36/25
Valid importance variance4/25
Variance-minimizing probability of outcome 11
Minimum valid variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p1/10
q1/2
a0
b4

A centered control changes the variance without shifting the target

A perfect control removes the variation

An exact centered control preserves the target meanA perfect control removes the variation; Both series have mean 3. The adjusted variance is 0, compared with 5 before adjustment.An exact centered control preserves the target mean-0.8406.84-0.273.270246Raw Y3333Adjusted observationShared exact meanUniform scenario index · observable value
Both series have mean 3. The adjusted variance is 0, compared with 5 before adjustment.

Subtract β times the centered control, whose mean is zero. Minimizing the resulting quadratic variance gives Cov(Y,C)/Var(C) when Var(C)>0. A coefficient estimated on the same finite data needs separate analysis.

Exact centered control calculation
QuantityExact result
Observable mean / control mean(3, 3/2)
Observable variance / control variance(5, 5/4)
Covariance5/2
Optimal coefficient2
Adjusted variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
points[[0,0],[2,1],[4,2],[6,3]]

Pairing helps only when the paired covariance is negative

Linear antithetic partners cancel exactly

Equal work makes the pairing comparison meaningfulLinear antithetic partners cancel exactly; The pair uses two function evaluations. Its variance is 0 versus 1/24 for two independent evaluations.Equal work makes the pairing comparison meaningful-0.1401.14-0.091.09g(u)g(1−u)Pair meanUniform input u · paired evaluations
The pair uses two function evaluations. Its variance is 0 versus 1/24 for two independent evaluations.

Expand the variance of the average. Covariance vanishes for independent evaluations but equals the integral of g(u)g(1−u) minus the squared mean in the paired design. The sign of this covariance determines whether pairing helps.

Exact equal-budget comparison
QuantityExact result
Mean1/2
One-evaluation variance1/12
Covariance of paired evaluations−1/12
Independent two-evaluation mean variance1/24
Antithetic pair mean variance0
Exact inputs and supporting calculations
Declared inputs
ParameterValue
gu

Allocation changes within-stratum error

Different strata reduce within-cell variance

Within-stratum variance depends on the actual fixed allocationDifferent strata reduce within-cell variance; Fixed counts allocate the declared evaluation budget across strata. The deterministic stratum, when present, contributes zero conditional variance. The fixed counts are n₁=4 and n₂=4.Within-stratum variance depends on the actual fixed allocationCrude · Total1/32Stratified · Total3/128Stratum 1 (n=4) · Part3/256Stratum 2 (n=4) · Part3/25600.0313Variance of the estimated mean
Fixed counts allocate the declared evaluation budget across strata. The deterministic stratum, when present, contributes zero conditional variance. The fixed counts are n₁=4 and n₂=4.

At fixed stratum counts independent stratum means add with weights w. Their variances are σ²/n within each stratum, so the weights enter squared. The continuous optimum under equal evaluation cost allocates in proportion to wσ, before any integer or identification constraints.

Exact within-cell variance and allocation
QuantityExact result
Target mean1/2
Conditional variances(3/16, 3/16)
Stratified contributions(3/256, 3/256)
Stratified total variance3/128
Equal-work crude variance1/32
Continuous Neyman shares0.5 / 0.5
Zero-variance stratumA known deterministic contribution needs no repeated sampling. An unknown deterministic value still needs an observation.
Exact inputs and supporting calculations
Declared inputs
ParameterValue
w["1/2","1/2"]
p["1/4","3/4"]
n[4,4]

A Markov-average variance depends on the full covariance sum

Positive persistence inflates averaging noise

Signed covariance terms determine the variance at finite nPositive persistence inflates averaging noise; Every nonzero lag is weighted by the exact number of ordered pairs. The finite variance is 89/200 compared with the independent benchmark 1/5.Signed covariance terms determine the variance at finite nLag 05Lag 14Lag 23/2Lag 31/2Lag 41/805Contribution to n² Var(mean)
Every nonzero lag is weighted by the exact number of ordered pairs. The finite variance is 89/200 compared with the independent benchmark 1/5.

A stationary ±1 chain has unit variance and lag covariance ρ^h under the stated conditional mean. Expand the variance of the sample sum into all ordered pairs and then divide by n². The long-run factor follows from the geometric covariance series.

Exact finite and long-run variance checks
QuantityExact result
Finite average variance89/200
Independent benchmark1/5
n × finite average variance89/40
Long-run n × variance limit3
Autocovariance at lag hρ^h
Exact inputs and supporting calculations
Declared inputs
ParameterValue
rho1/2
n5

Worked examples

Integrating a quadratic by independent sampling

For U uniform on (0,1), estimate the integral of x squared by averaging U squared. Derive the exact mean and variance, the unbiased sample-variance formula, and a valid fixed-sample bounded-error requirement for tolerance epsilon and failure probability alpha. Distinguish the finite guarantee from a normal approximation.

  1. Write Y=U squared. Its expectation is integral_0^1 x squared dx=1/3, the requested integral. Its second moment is E U to the fourth=integral_0^1 x to the fourth dx=1/5. Consequently Var(Y)=1/5-(1/3) squared=4/45. For n independent uniforms, the estimator I_n=(1/n)sum_i U_i squared is unbiased and its variance is Var(Y)/n=4/(45n), since all different-draw covariances vanish. The independent uniform sampling law, rather than the numerical appearance of a list of points, is the hypothesis behind this division by n.
  2. For n>=2, the sample variance of the Y_i is s squared=(1/(n-1))sum_i(Y_i-I_n) squared=[sum_i U_i to the fourth-n I_n squared]/(n-1). Expanding around mu=1/3 gives sum_i(Y_i-I_n) squared=sum_i(Y_i-mu) squared-n(I_n-mu) squared. Taking expectations yields n Var(Y)-n Var(Y)/n=(n-1) Var(Y), proving E s squared=4/45. Thus s squared/n is unbiased for the estimator variance. The n=1 case has no unbiased sample-variance formula with this denominator, even though its known population variance is still 4/45.
  3. Every Y_i lies between zero and one, so the bounded-observation inequality gives P(|I_n-1/3|>=epsilon)<=2 exp(-2n epsilon squared). For epsilon>0 and failure probability 0<alpha<1, taking n>=log(2/alpha)/(2 epsilon squared) makes that bound at most alpha; round upward to a positive integer. This is a sufficient finite-sample requirement with a known range, not an estimate made by substituting the observed minimum and maximum. It can be conservative and is not an assertion that the rounded count is the smallest possible exact count.
  4. Because the nonzero finite variance is known, the iid central limit also gives square root n(I_n-1/3)/square root(4/45) tending to a standard normal. The bounded moments make the sample variance consistent, so replacing the population standard deviation by s gives an asymptotic interval I_n plus or minus a normal quantile times s/square root n. This approximation does not have the exponential bound's finite-n coverage guarantee, and repeatedly inspecting such a fixed-time interval requires a separate simultaneous argument. The exact mean, variance, unbiased variance estimate and finite probability bound are therefore distinct conclusions.

For n independent draws the mean is 1/3 and the variance is 4/(45n). For n>=2 use s squared=[sum_i U_i to the fourth-n(Ybar) squared]/(n-1). For epsilon>0 and 0<alpha<1, n>=max(1,ceil(log(2/alpha)/(2 epsilon squared))) gives the stated finite bounded-error guarantee.

A rare event with no observed successes

An event has probability 1/10000 and is observed in 10000 independent trials. Derive the exact relative standard deviation and probability of no successes. If instead its probability is unknown and no success was observed, derive the level 1-alpha upper bound and explain what zero empirical variance does not establish.

  1. Let K be the number of successes in n=10000 independent Bernoulli trials, with p=1/10000. Its probability estimate is phat=K/n, with E phat=p and Var(phat)=p(1-p)/n. Dividing its standard deviation by p gives square root((1-p)/(np)). Here np=1 and 1-p=9999/10000, so the relative standard deviation is square root(9999/10000). This quantity is near one despite ten thousand trials: the relevant count for relative precision is the expected number of successes, which is only one.
  2. The event K=0 requires every independent trial to fail. Its exact probability is (1-p)^n=(9999/10000)^10000. No normal approximation is needed for that expression. A particular record with no successes produces phat=0 and zero sample variance of the observed indicators, even though the declared Bernoulli law has strictly positive variance and strictly positive success probability. The event is permitted by that law, so the observed variance is not a proof that its true variance vanishes.
  3. Now suppose p is unknown. For any proposed p0, P_p0(K=0)=(1-p0)^n, a decreasing function of p0. Solving (1-u)^n=alpha gives u=1-alpha^(1/n), hence the claimed endpoint for n=10000. To exhibit a complete one-sided confidence procedure, report U(K)=u when K=0 and U(K)=1 otherwise. If the true p<=u, the upper bound always covers. If p>u, failure is possible only on K=0 and has probability (1-p)^n<alpha. Thus P_p(p<=U(K))>=1-alpha for every p, with the usual inclusive endpoint convention.
  4. This endpoint is the upper bound after zero successes; the simplified complete procedure just given is intentionally uninformative after a positive count, and other exact binomial procedures can improve those cases. The coverage is a repeated-sampling property, not a posterior probability that the unknown fixed p lies below u. A zero-count record does not set p or its variance to zero, certify a relative error around zero, or justify excluding rare outcomes from the model. A required relative precision instead needs enough expected events or another valid estimator and uncertainty argument.

The relative standard deviation of the empirical probability is square root(9999/10000), and the no-success probability is (9999/10000)^10000. With unknown p and zero successes, the one-sided level 1-alpha upper endpoint is 1-alpha^(1/10000); zero observed variance does not show p=0.

An alias table from actual masses

Construct and prove a three-column alias sampler for probabilities (1, 2, 3)/6. Give every column threshold and alias, verify the resulting masses and state how the algorithm treats a zero target mass.

  1. The three target probabilities are (1/6,2/6,3/6). Multiply them by the number of equally likely columns, obtaining scaled masses (1/2,1,3/2). A column has unit capacity. The first state fills half of column 0, and state 2 supplies the missing half. State 1 fills column 1 completely; the remaining mass of state 2 fills column 2 completely. Thus set thresholds t0=1/2,t1=t2=1 and aliases a0=2,a1=1,a2=2. Aliases in the two full columns are unused and are chosen as their own indices for definiteness.
  2. Choose J uniformly among the three columns, and independently choose U uniform on (0,1). If U<t_J output J; otherwise output a_J. The probability of state 0 is P(J=0,U<1/2)=(1/3)(1/2)=1/6. State 1 receives its entire column, mass 1/3. State 2 receives all of column 2 plus the alias half of column 0, giving 1/3+1/6=1/2. These probabilities are exactly the requested normalized masses and add to one. Endpoint choices for U at a threshold have probability zero under the continuous uniform law.
  3. This construction is a mass-conservation proof, not a table inferred from simulated frequencies. In the general finite construction a small column of scaled mass s<1 receives its own threshold s and an alias from a large state. Supplying the missing amount 1-s subtracts that amount from the large state's residual mass. The remaining residual sum equals the number of unfilled columns, so the operation can continue until full columns remain. Our particular residual large mass 3/2 becomes 1 after supplying 1/2, exactly as the displayed table requires.
  4. A target state with probability zero begins with scaled mass zero. Its column receives threshold zero and is filled entirely through an alias from a positive residual mass; a continuous U then never returns the zero-mass column label. Such a zero-mass state is not selected as a large supplier, so it does not receive probability through other aliases either. The input masses must be nonnegative with a finite positive total before normalization; an all-zero vector is not a probability law. The uniforms and table arithmetic are the sampler assumptions, and a finite observed histogram is not a replacement for this exact mass verification.

Choose a uniform column J in {0,1,2} and independent U uniform on (0,1). Thresholds are (1/2,1,1), with aliases (2,1,2). Return J if U is below its threshold, otherwise its alias. The masses are (1/6,1/3,1/2); a zero-mass column has threshold 0 and never returns its own state.

A rejection envelope and a clipped mistake

Sample density 2x on (0, 1) using a uniform proposal. Prove a valid envelope, accepted law, acceptance probability, expected proposal count and mean output. Then derive the actual law and mean obtained by incorrectly using envelope 1 and clipping the acceptance probability at one.

  1. On (0,1) the normalized target density is h(x)=2x and the uniform proposal density is q(x)=1. The envelope h<=Cq holds with C=2. Draw X uniformly and accept when an independent uniform V is at most h(X)/(2q(X))=X. The unconditional acceptance probability is integral_0^1 x dx=1/2. For any measurable A, the joint probability of acceptance and X in A is integral_A x dx, so the accepted density is x/(1/2)=2x. This division by the actual total acceptance probability proves the output law.
  2. Independent complete proposal attempts make the number K up to the first acceptance geometric on {1,2,...} with success probability 1/2: P(K=k)=(1/2)^k. The tail-sum formula gives E K=sum_(k>=1)P(K>=k)=sum_(k>=1)(1/2)^(k-1)=2. The accepted output mean is integral_0^1 x(2x) dx=2/3. Attempt count and accepted value are independent, since P(K=k,output in A)=(1/2)^(k-1) integral_A x dx factors into P(K=k) times integral_A 2x dx.
  3. Using C=1 violates h<=Cq for x>1/2. If the implementation clips the putative ratio, its actual acceptance function becomes a_bad(x)=min(1,2x). Its total acceptance is integral_0^(1/2)2x dx+integral_(1/2)^1 1 dx=1/4+1/2=3/4. Therefore the actual accepted density is a_bad(x)/(3/4)=(4/3) min(1,2x), or 8x/3 below 1/2 and 4/3 above 1/2. The law no longer has density 2x; a higher acceptance rate alone cannot make an invalid envelope correct.
  4. The bad-rule mean is [integral_0^(1/2)2x squared dx+integral_(1/2)^1 x dx]/(3/4). The first integral is 1/12 and the second 3/8, with sum 11/24, giving mean 11/18 after normalization. Its mean attempt count is 4/3, which is smaller than the valid sampler's 2 because it accepts excess mass in the upper half under a different rule. The target mean 2/3 differs from 11/18 by 1/18. Correct normalization of an implemented acceptance function is essential; clipping a ratio that exceeds one conceals the broken envelope instead of repairing the target law.

Envelope C=2 gives acceptance x, acceptance probability 1/2, geometric mean proposal count 2 and accepted mean 2/3. The invalid clipped C=1 rule has density (4/3) min(1,2x), acceptance probability 3/4 and mean 11/18, so it samples a different law.

Importance sampling for an exponential tail

For an exponential rate-one variable, estimate the probability of exceeding a=log(1000) using an exponential rate-one-half proposal. Derive the exact second moment, relative variance and support conditions, and compare with direct Bernoulli sampling at equal accepted sample count. State separately how unequal simulation costs would change the comparison.

  1. The target density is p(x)=exp(-x) for x>0. Its tail probability beyond a=log(1000) is I=integral_a^infinity exp(-x) dx=exp(-a)=1/1000. The proposal is q(x)=(1/2) exp(-x/2), positive throughout the target support. Its likelihood ratio is p/q=2 exp(-x/2), so Y=2 exp(-X/2)1_(X>a) under q has expectation integral_a^infinity p(x) dx=I. The indicator and likelihood ratio must both be retained; simply counting proposal tail hits would estimate the larger proposal tail probability instead.
  2. The second moment is E_q Y squared=integral_a^infinity 4 exp(-x) (1/2) exp(-x/2) dx=2 integral_a^infinity exp(-3x/2) dx=(4/3) exp(-3a/2). Hence Var_q(Y)=(4/3) exp(-3a/2)-exp(-2a). Dividing by I squared gives the single-draw relative variance (4/3) exp(a/2)-1=(4/3) square root 1000-1. The weighted output is bounded by 2, so its integrability and finite second moment are not assumptions inferred from a finite run. Averaging n independent complete proposal draws divides that relative variance by n.
  3. Direct target sampling uses the Bernoulli output B=1_(X>a), with Var(B)=I(1-I). Its single-draw relative variance is (1-I)/I=999, and its n-draw relative variance is 999/n. At the same number of complete counted draws, including zero outputs in both methods, the importance estimator has the smaller variance; the improvement factor is 999/[(4/3) square root 1000-1]. The comparison does not condition on observing a positive tail hit, since discarding zero outputs or counting only successes would change the estimator and cost accounting.
  4. If mean work per direct draw is c_p and per proposal/weight calculation is c_q, a large fixed work budget B gives approximate relative variances 999 c_p/B and [(4/3) square root 1000-1]c_q/B, with actual integer counts handled separately. Importance sampling is better at equal work only if its variance reduction outweighs c_q/c_p. Support domination and the exact likelihood ratio remain mandatory even when the variance appears favorable. Neither a small weighted empirical variance nor the number of accepted outputs alone certifies an unknown proposal cost, a correct target law or coverage of a chosen finite-sample error interval.

With a=log(1000), I=1/1000 and importance output Y=2 exp(-X/2)1_(X>a), X exponential rate 1/2. E Y squared=(4/3)1000^(-3/2). Its single-draw relative variance is (4/3) square root 1000-1, versus 999 directly; for n independent draws divide each by n. Cost must be compared separately.

A biased ratio and its weight diagnostic

Draw equally likely states 0 and 1, use unnormalized target masses 1 and 3 and observable f(x)=x. Derive the normalized target mean, the one-sample self-normalized mean and bias, its asymptotic ratio variance and the population weight effective-sample-size fraction. Explain why these are different quantities.

  1. The target masses h=(1,3) normalize by total 4, giving probabilities (1/4,3/4) and mean mu=3/4 for f(x)=x. Under q=(1/2,1/2), the full importance ratios h/q are (2,6), but dividing both weights by 2 gives equivalent self-normalized weights W=(1,3). Then E_q W=2 and E_q(W f)=3/2, whose ratio is 3/4. All weights are positive, so the realized ratio denominator is positive at every sample size. This normalization invariance does not change its finite-sample distribution.
  2. For n=1 the self-normalized estimate W(X)f(X)/W(X) is exactly X. The proposal chooses either state with probability 1/2, hence its expectation is 1/2 and its bias for mu is 1/2-3/4=-1/4. The numerator and denominator are individually unbiased for their respective unnormalized sums after a consistent scale choice, but the expectation of their ratio is not the ratio of their expectations. This is an explicit nonzero finite-sample bias without a support failure or a zero-weight event.
  3. Let A=W(f-mu). Its two possible values are -3/4 at state 0 and 3/4 at state 1, each with probability 1/2. Therefore E A=0 and E A squared=9/16. Algebra gives the n-sample ratio error as average(A)/average(W). The iid central limit for the centered A average and the strong law average(W)->2 give square root n(ratio-mu) tending to a centered normal with variance (9/16)/4=9/64. This is an asymptotic fluctuation constant, so the leading variance scale is 9/(64n) under the stated iid law; it neither asserts exact finite-n variance nor removes the n=1 bias just calculated.
  4. The population normalized weight effective-size fraction is (E W) squared/E W squared. Here E W squared=(1+9)/2=5, so the fraction is 4/5. For many iid draws, the weight diagnostic ( sum W) squared/sum W squared divided by n converges to that fraction. It is independent of which observable is later estimated, unlike the ratio variance 9/64. With one positive-weight draw the realized weight ESS is 1, even though the target-mean bias is -1/4. Thus a favorable or even maximal finite weight diagnostic supplies no proof of unbiased normalized expectations, negligible error or serial independence.

The target mean is 3/4. With one draw the self-normalized estimate is X, with mean 1/2 and bias -1/4. The asymptotic variance constant is 9/64; the population weight-ESS fraction is 4/5. They measure finite bias, observable-specific ratio fluctuation and weight dispersion respectively.

A control and an antithetic pair for the same integral

For the integral of x squared under a uniform input, use control x with known mean 1/2 and independently fixed optimal coefficient. Derive the coefficient and exact reduced variance. Compare the reflected antithetic estimator at the same total number of function evaluations and explain the different variance-reduction factors.

  1. Let Y=U squared and C=U, with U uniform on (0,1). The known control mean is E C=1/2, Var(C)=1/12 and Var(Y)=4/45. Also Cov(Y,C)=E U cubed-E U squared E U=1/4-1/6=1/12. For a coefficient beta fixed independently of the evaluated observations, the adjusted output A_beta=U squared-beta(U-1/2) retains mean 1/3. Its variance is 4/45-2 beta/12+beta squared/12. Completing the square or differentiating this deterministic quadratic gives the unique optimum beta=1.
  2. At beta=1 the output is A=U squared-U+1/2. Its variance is 4/45-(1/12) squared/(1/12)=4/45-1/12=1/180. Averaging n independent adjusted draws therefore has variance 1/(180n), versus 4/(45n)=16/(180n) for unadjusted iid sampling: a factor 16 reduction at the same n evaluations of the quadratic. The coefficient here is derived analytically, not fitted on those same observations. If estimating it or evaluating the control has nonnegligible extra cost, the equal-work comparison must include that cost separately.
  3. The reflected antithetic pair output is B=[U squared+(1-U) squared]/2=U squared-U+1/2, algebraically the same scalar as A. Its two constituent terms are dependent: E[U squared (1-U) squared]=1/30, so their covariance is 1/30-1/9=-7/90. Consequently Var(B)=[2(4/45)+2(-7/90)]/4=1/180, agreeing with the algebraic identity. Both marginals still have the uniform-input quadratic law, which is why the pair mean is unbiased.
  4. With m independent base uniforms the average of m such pairs has variance 1/(180m) and uses 2m function evaluations. An unadjusted iid estimator using the same 2m evaluations has variance 4/(90m), yielding improvement factor 8. A control estimator using 2m independent adjusted draws instead has variance 1/(360m), giving factor 16. Confusing a pair with one independent function evaluation would claim the wrong antithetic gain. The derivation compares quadratic evaluations explicitly and does not declare all implementations equally costly or the two values inside each pair independent.

The fixed optimal control coefficient is 1 and its per-draw variance is 1/180, a factor 16 improvement over iid U squared. A reflected pair has the same variance 1/180 per pair but uses two evaluations; at the same total count its improvement factor is 8.

Allocating a two-stratum calculation

For f(x)=x squared on (0,1), split the interval into equal halves and draw m independent uniform points in each. Derive both conditional means and variances, the estimator variance and its equal-total-count improvement over iid sampling. Derive the continuous Neyman allocation and identify its integer-allocation limitation.

  1. In the lower half the conditional uniform density is 2 on (0,1/2). Thus E_low X squared=2(1/2) cubed/3=1/12 and E_low X to the fourth=2(1/2) to the fifth/5=1/80. Its variance is 1/80-1/144=1/180. In the upper half the conditional density is 2 on (1/2,1), giving mean 2(1-1/8)/3=7/12 and fourth moment 2(1-1/32)/5=31/80. Its variance is 31/80-49/144=17/360. These are conditional within-stratum moments; including the difference between the two means again would double-count the between-stratum variation.
  2. With m independent draws in each half and independent draws across halves, estimate I by half the lower sample mean plus half the upper sample mean. Its mean is (1/2)(1/12+7/12)=1/3. Its variance is (1/4)[(1/180)/m+(17/360)/m]=19/(1440m). At n=2m total evaluations this is 19/(720n). The unstratified iid variance 4/(45n)=64/(720n), so the same-count improvement is 64/19. The stratum masses 1/2 are known exactly; replacing them by noisy estimated masses would require an additional variance analysis.
  3. For a general continuous split n_low+n_up=n with both counts positive, the variance is (1/4)[sigma_low squared/n_low+sigma_up squared/n_up]. Cauchy-Schwarz shows its minimum is [(sigma_low+sigma_up)/2] squared/n, attained when counts are proportional to the conditional standard deviations. Here sigma_up/sigma_low=square root[(17/360)/(1/180)]=square root(17/2). Hence n_low*=n/[1+square root(17/2)] and n_up*=n square root(17/2)/[1+square root(17/2)]. Larger variance in the upper half calls for more evaluations there, not equal allocation merely because the two interval lengths agree.
  4. Actual sample counts are integers and each unknown stratum mean needs a positive count. For n>=2, minimize the exact convex function over integer n_low in {1,...,n-1}; checking the feasible floor and ceiling nearest the continuous optimum, with endpoint clipping, gives the integer optimum. Its variance need not equal the continuous lower bound, particularly for small n. If counts are chosen from a pilot, a fresh conditionally valid sample or another selection argument is needed before treating the allocation as fixed in this formula. Analytic moment knowledge makes this an illustrative allocation calculation rather than a claim that simulation was necessary to discover the integral.

The lower/upper conditional means are 1/12 and 7/12 and variances 1/180 and 17/360. With m draws per half, variance is 19/(1440m)=19/(720n), n=2m, versus 64/(720n) iid. Continuous optimal upper/lower count ratio is square root(17/2); integer positive counts require separate rounding.

A randomized lattice cancels one frequency

Use four equally spaced torus points and one uniform random shift. Derive the estimate and variance for f(x)=cos(2 pi*x) and for g(x)=cos(8 pi*x). Explain how R independent shifts estimate uncertainty and why the four within-shift values are not four independent replicas.

  1. Use points (U+j/4) modulo one, j=0,1,2,3, with one uniform U. For f(x)=cos(2 pi x), their average is the real part of exp(2 pi i U)[1+i-1-i]/4, which is exactly zero. The true integral is also zero, so the shifted-rule estimate is exact for this frequency for every shift and has variance zero. This cancellation is an algebraic property of the point set and integrand, not a conclusion drawn from seeing an empirical variance vanish.
  2. For g(x)=cos(8 pi x), shifting by j/4 changes the phase by 2 pi j, so all four values equal cos(8 pi U). Their average is therefore cos(8 pi U), not a more concentrated average of four independent cosines. Integrating over U gives mean zero and second moment 1/2 by the identity cos squared t=(1+cos2t)/2. Thus its variance is 1/2. The frequency four resonates with the four-point lattice and survives its frequency filter.
  3. For R independent uniform shifts U_r, the R full quadrature outputs are iid. Averaging the g outputs gives variance 1/(2R), using 4R function evaluations in total. For R>=2 the sample variance of these R scalar outputs is unbiased for 1/2; dividing it by R estimates the variance of their mean. The bounded iid outputs also permit a valid bounded concentration argument, or an asymptotic normal approximation under its usual interpretation. For f, each replicate output is identically zero by the proven cancellation, so its variance is exactly zero under this particular integrand and construction.
  4. Counting the four values in a g shift as four independent replicas would divide variance by an extra factor 4 and report 1/(8R), although their actual common-shift covariance is 1/2. For f the within-shift dependence instead creates exact cancellation. The effect of dependence therefore cannot be settled by a general assertion that all lattice points help or all dependence hurts. Independent randomizations provide replicate uncertainty; within each randomization the specific point geometry and integrand frequencies determine its variance.

With four shifted equally spaced points the cos(2 pi*x) estimate is identically 0 with variance 0. The cos(8 pi*x) estimate is cos(8 pi*U), with mean 0 and variance 1/2. R independent shifts give variance 1/(2R) for the latter average; the four values within one shift are dependent.

A reversible sampler with negative correlation

For target masses (1, 2, 1)/4 on three states, propose either other state with probability 1/2 and apply Metropolis acceptance. Derive the full kernel, invariant law, irreducibility and aperiodicity. For f=(1, 0, -1), derive its stationary covariance, exact finite average variance, limiting variance and correlation effective sample size.

  1. From state 0, either proposed other state has target mass at least its own, so both proposals are accepted: K01=K02=1/2 and K00=0. From state 1, a proposal to either outer state is accepted with probability (1/4)/(1/2)=1/2, giving K10=K12=1/4 and rejection K11=1/2. State 2 is symmetric to state 0. Every pairwise flow balances: for example pi0 K01=(1/4)(1/2)=1/8=pi1 K10, with the other pairs checked the same way. Thus the displayed pi is invariant. Every off-diagonal entry is positive, proving irreducibility, and the self-loop at state 1 gives period one throughout the communicating class.
  2. For f=(1,0,-1), pi f=0 and pi f squared=1/2. Multiplying the kernel gives Kf=(-1/2,0,1/2)=(-1/2)f. In stationarity the lag-k covariance is therefore gamma_k=<f,K^k f>_pi=(1/2)(-1/2)^k. Consecutive states are negatively correlated for this observable despite every transition being an ordinary target-preserving Metropolis move. Stationary initialization is essential to this covariance formula as written; a general initial law needs its separate finite-run bias and covariance treatment.
  3. Expanding the variance of the average of n consecutive stationary observations gives Var(A_n)=[n/2+sum_(k=1)^(n-1)(n-k)(-1/2)^k]/n squared. For a general lambda different from 1, n+2sum_(k=1)^(n-1)(n-k) lambda^k=n(1+lambda)/(1-lambda)-2 lambda(1-lambda^n)/(1-lambda) squared. Substitution of lambda=-1/2 and the leading factor 1/2 yields Var(A_n)=1/(6n)+2[1-(-1/2)^n]/(9n squared). At n=1 it returns 1/2, the actual marginal variance. This finite correction is retained rather than replacing every finite-n variance by its limit.
  4. The limit n Var(A_n)=1/6 follows because the correction is O(1/n). Relative to marginal variance gamma0=1/2, the finite correlation factor is tau_n=1/3+4[1-(-1/2)^n]/(9n), so the exact variance-matching effective size is n/tau_n and is asymptotic to 3n. More than n effective observations here means the average has smaller variance than n independent pi draws of this observable; it does not make its n actual states independent or create additional physical evaluations. The factor concerns serial covariance, not unequal-weight ESS, and this second-moment derivation alone is not a central-limit proof.

K has rows (0,1/2,1/2),(1/4,1/2,1/4),(1/2,1/2,0), invariant pi=(1,2,1)/4. In stationarity gamma_k=(1/2)(-1/2)^k and Var(A_n)=1/(6n)+2[1-(-1/2)^n]/(9n squared). The limiting variance is 1/6 and asymptotic correlation ESS is 3n.

One particle can estimate a normalizer without an unbiased posterior

Start with equally likely hidden states 0 and 1, take identity transition, and potentials G0=(1, 3), G1=(2, 1). Derive the exact two-potential normalizer and normalized final state-one probability. For a bootstrap system with one particle, derive the normalizer estimate’s law and mean and the normalized state estimate’s mean; distinguish the two unbiasedness claims.

  1. There are only two possible constant hidden paths because the transition is the identity. Their unnormalized masses after both potentials are (1/2) times 1 times 2=1 for state 0 and (1/2) times 3 times 1=3/2 for state 1. Summing gives the exact normalizer Z1=5/2. Normalizing the state 1 mass gives (3/2)/(5/2)=3/5. This target concerns both potentials together; normalizing after the first potential and ignoring the second would give a different question.
  2. With one bootstrap particle, its initial state is equally likely 0 or 1. After G0 the empirical normalized law is concentrated on that sole particle, so resampling must pick it again. Identity propagation keeps the state unchanged. The product normalizer estimate is consequently G0(X)G1(X), equal to 2 in state 0 and 3 in state 1. Both values have probability 1/2, yielding E Zhat1=(2+3)/2=5/2 and Var(Zhat1)=(4+9)/2-(5/2) squared=1/4. The dependence of the two factors through X has been retained.
  3. The normalized empirical state-one estimate remains 1_(X=1), since a single positive-weight particle carries all normalized mass. Its expectation is 1/2, not 3/5, with bias -1/10. By contrast the unnormalized state-one mass estimate is Zhat1 times that indicator, taking values 0 and 3; its expectation is 3/2, exactly the target unnormalized state-one mass. Thus both the total unnormalized mass and this unnormalized observable are unbiased, while their realized ratio need not be.
  4. Every potential in this example is positive, so no zero-weight extinction or undefined denominator is responsible for the posterior bias. It is the finite-sample normalization itself. Exact resampling and a correct model do not change the one-particle calculation, and repeating only a selected favorable particle would change the procedure. Increasing particle count may improve approximation under suitable results, but unbiasedness of the normalizer is not evidence that a finite normalized posterior or a state probability is unbiased.

The true normalizer is 5/2 and the final state-one probability is 3/5. With one particle Zhat is 2 or 3, each with probability 1/2, so it is unbiased. The normalized state-one estimate is 0 or 1 with mean 1/2, which is biased for 3/5.

A coupled hierarchy under a fixed work budget

Let P0=1/2+Z0 and P1=3/4+Z0+Z1/4 with independent standard normal variables. A coarse draw costs 1 work unit; a coupled difference or direct fine draw costs 16. Under total budget 64, derive the optimal continuous two-level allocation, verify its integer values, calculate the exact multilevel variance and compare with direct fine sampling. There is no truncation bias beyond the chosen level-one target.

  1. The coarse output P0=1/2+Z0 has mean 1/2 and variance V0=1. In a coupled fine-minus-coarse pair use the same Z0 in both levels, so Y1=P1-P0=1/4+Z1/4, with mean 1/4 and variance V1=1/16. The cancellation of Z0 is the benefit of the actual coupling. Take independent sample groups for coarse outputs and coupled differences, making the two level averages independent. Their sum is unbiased for E P1=3/4 and has variance 1/N0+1/(16N1).
  2. The work constraint is N0+16N1=64, because a coarse draw costs 1 and a coupled difference costs 16. For continuous positive counts, Cauchy-Schwarz bounds variance times work below by [square root(V0 C0)+square root(V1 C1)] squared=(1+1) squared=4. Equality requires N0/N1=square root[(V0/C0)/(V1/C1)]=16. Solving N0=16N1 with the budget gives N1=2 and N0=32. These counts are already positive integers and exhaust the budget, so the continuous lower bound is attained within the integer feasible set as well.
  3. The resulting multilevel variance is 1/32+(1/16)/2=1/16. Each direct fine draw has variance Var(Z0+Z1/4)=1+1/16=17/16 by independence of its two normals. The same 64-unit budget buys four independent direct fine draws, whose average has variance (17/16)/4=17/64. The ratio of the direct variance to the multilevel variance is (17/64)/(1/16)=17/4. Both estimates have the same exact target mean 3/4, so this is a variance/work comparison rather than a difference in systematic accuracy.
  4. There is no additional hierarchy truncation bias because the requested target is already level one. The proof does not presume that the level-one variable equals an unmentioned limiting physical process. If the two levels in a difference were simulated independently, the canceled Z0 noise would reappear and the allocation variances would change. If coarse draws were reused across level averages, cross-level covariance would also need inclusion. The declared coupling, independent level groups, actual costs and integer counts are all part of this exact comparison.

The optimal allocation is N0=32 coarse draws and N1=2 coupled differences, using exactly 64 work units. Its unbiased level-one estimate has variance 1/16, versus 17/64 from four direct fine draws; the equal-work improvement is 17/4.

Try it yourself

  1. For iid uniform inputs on (0,1), derive the mean and variance of the average of the inputs and the Chebyshev sample requirement for a stated tolerance and failure probability. Explain the physical units of its variance.

    Show the answer and reasoning

    The uniform-input average has mean 1/2 and variance 1/(12n). For epsilon>0 and 0<alpha<1, n>=max(1,ceil(1/(12 alpha epsilon squared))) is a sufficient Chebyshev requirement. Variance has squared observable units.

    For U uniform on (0,1), E U=integral_0^1 x dx=1/2 and E U squared=integral_0^1 x squared dx=1/3. Subtracting the squared mean gives Var(U)=1/3-1/4=1/12. With n independent copies, their average A_n has expectation 1/2 and variance n(1/12)/n squared=1/(12n). The cancellation of different-draw covariance uses independence; the same marginal uniform law for dependent inputs would not be enough. For epsilon>0 apply the nonnegative-variable inequality to (A_n-1/2) squared: P(|A_n-1/2|>=epsilon)<=E(A_n-1/2) squared/epsilon squared=1/(12n epsilon squared). To make this no larger than a prescribed failure probability 0<alpha<1, it suffices to take n>=1/(12 alpha epsilon squared), rounded upward to a positive integer. This is a valid sufficient finite-sample requirement. It is not claimed to be the sharpest uniform-input bound, and a normal-quantile count would answer an asymptotic rather than this Chebyshev question. The mathematical U on (0,1) is dimensionless. If an observation instead represents X=a+L U, with a and L expressed in a common physical unit, then E X=a+L/2 and Var(average X)=L squared/(12n). Its standard deviation has the original observable unit, while its variance has that unit squared. The tolerance epsilon_X in the probability statement must also have the original unit, so the corresponding count is L squared/(12 alpha epsilon_X squared). A variance cannot be added directly to an absolute error tolerance. The requirement treats n as a fixed declared count and the observations as iid. It supplies no simultaneous guarantee after repeatedly inspecting a sequence of means without allocating further error probability. At epsilon=0 the displayed division is undefined and this positive-tolerance argument gives no finite exact-recovery count. The known population variance and units come from the declared law; a small realized sample variance or a short list of evenly spaced inputs does not independently certify that law or its sampling assumptions.

  2. For an exactly constant observable, derive the sample mean, sample variance and bounded-error branch for every positive sample count. Explain why dividing by an estimated standard deviation is not defined.

    Show the answer and reasoning

    If Y=c exactly, every positive-count mean is c. The empirical central second moment is 0 for every n; the usual unbiased sample variance is 0 for n>=2 and undefined for n=1. Use the exact interval [c,c], rather than dividing by a zero estimated standard deviation.

    The premise says each observation equals the same deterministic constant c almost surely. Therefore for every integer n>=1, A_n=(1/n)sum_i c=c almost surely. The population variance and the variance of A_n are both zero. No independence assumption is needed to average exact constants; their entire joint law is already concentrated on one value. This is a consequence of the stated constant-observable hypothesis, not an inference drawn from a finite record whose entries happen to agree. The empirical central second moment (1/n)sum_i(Y_i-A_n) squared is zero for every n>=1. The conventional unbiased sample variance uses denominator n-1, so it is well-defined and zero only for n>=2. At n=1 it is the undefined expression 0/0; labeling it an unbiased zero estimate would erase a genuine definition boundary. If the population constant is independently known, its population variance zero remains known even when the sample-variance statistic is not defined. A known deterministic range [c,c] has width zero. Treat the bounded-error branch directly: P(|A_n-c|>epsilon)=0 for every epsilon>=0, including exact recovery at epsilon=0. The exact confidence set is the singleton [c,c] at every positive sample count. Formulas derived for a positive range or a positive variance must not be used by dividing through that zero quantity. A standardized statistic square root n(A_n-c)/s is undefined, rather than a standard normal random variable with miraculous precision. A degenerate central-limit statement can describe convergence to the point mass at zero without standardization, but it does not turn 0/0 into a meaningful test statistic. Conversely, an observed constant sample from an unknown nonconstant law may miss a rare alternative and need not have zero true variance. The exact branch depends on an established constant-observable model. This distinction keeps a harmless deterministic case separate from a misleading empirical claim about unseen outcomes.

  3. Construct a generalized-inverse sampler for a law with probability 1/3 at zero and 2/3 at two. Prove the output probabilities and state the uniform-input endpoint conventions.

    Show the answer and reasoning

    For U uniform on (0,1), return 0 when U<=1/3 and 2 otherwise. The generalized inverse yields masses 1/3 and 2/3. Exclude U=0 from the literal infimum definition, or supply a separate endpoint extension; U=1 can be assigned 2 for this bounded law.

    The target cumulative distribution is F(x)=0 for x<0, F(x)=1/3 for 0<=x<2, and F(x)=1 for x>=2. It has jumps and a flat interval, so an ordinary strictly increasing inverse is unavailable. For 0<u<1 define the generalized inverse Q(u)=inf{x:F(x)>=u}. If 0<u<=1/3, the smallest such x is 0. If 1/3<u<1, the smallest such x is 2. In particular the convention F(x)>=u assigns the exact level u=1/3 to 0. Take a continuous uniform U on (0,1), and set X=Q(U). Then P(X=0)=P(U<=1/3)=1/3 and P(X=2)=P(U>1/3)=2/3. More generally the sampler cumulative law is zero below 0, equals 1/3 between 0 and 2, and equals one from 2 onward, exactly F. This direct verification handles the atom rather than differentiating F or pretending it has an everywhere positive density. The open interval removes the problematic u=0 from the literal infimum formula: because F(x)>=0 for all real x, that infimum would be minus infinity rather than the desired support endpoint. One may separately define Q(0)=0 as an extension, but must name it. At u=1 this particular bounded law has Q(1)=2, so assigning the endpoint to 2 is harmless when the continuous uniform law gives it zero mass. For an unbounded law the analogous endpoint may be infinite, which is another reason to state uniform-input conventions explicitly. A continuous uniform has no mass at 0,1 or 1/3, so changing a single threshold endpoint does not change its output probabilities here. A discrete computer grid can put positive mass at those values and need a separate grid-law assessment; it is not literally the same continuous uniform assumption. Atoms in the target are fully compatible with generalized inversion, while flat CDF intervals simply produce no output values inside those gaps. Correct threshold probabilities, rather than a smooth inverse formula, establish this sampler.

  4. Derive an exponential rate-lambda sampler from a uniform input, prove its law and mean for lambda>0, and explain why rate zero is not handled by division by lambda.

    Show the answer and reasoning

    For lambda>0 use T=-log(1-U)/lambda with U uniform on (0,1). Then P(T>t)=exp(-lambda t) for t>=0 and E T=1/lambda. A zero rate means no finite arrival in the zero-clock interpretation; it is a separate extended-infinite waiting-time branch.

    Let lambda>0 and U be uniform on (0,1). Since 0<1-U<1, T=-log(1-U)/lambda is finite and positive almost surely. For t>=0, T>t is equivalent to U>1-exp(-lambda t). The uniform tail probability is therefore exp(-lambda t). For t<0, T>t has probability one. Thus the cumulative distribution is zero below zero and 1-exp(-lambda t) for t>=0, proving the exponential rate-lambda law directly from the input distribution. The mean of a nonnegative random variable is the integral of its survival probability, by Tonelli applied to T=integral_0^infinity 1_(T>t) dt. Consequently E T=integral_0^infinity exp(-lambda t) dt=1/lambda. If time has a physical unit, lambda has reciprocal-time units and lambda t is dimensionless; the inverse-rate mean has the original time unit. The distributional proof and finite mean both use strict positivity of lambda. The open-uniform convention avoids log(0) at U=1. A separately assigned U=0 would give T=0, an endpoint with zero mass under the continuous model, while U=1 would require an infinite value. The equivalent transform -log(U)/lambda also has the exponential law for a continuous open uniform, but it maps each individual input differently and has its singular endpoint at 0. Actual discrete generator endpoints and rounding require their own declared convention rather than an unexplained log(0) repair. At lambda=0 the displayed quotient is undefined, and the expression lambda exp(-lambda t) is identically zero rather than a normalized finite-time density. In a zero-arrival-rate model the survival is one at every finite t, represented by T=infinity almost surely on an extended state space. That branch has infinite mean and no finite first arrival. It is not obtained by setting an invalid division result to zero. Negative lambda is not a waiting-time rate under this construction either.

  5. For an unnormalized target h(x)=3x squared on (0, 1) with uniform proposal, derive a valid rejection envelope, normalizer, acceptance law and expected proposal count. Verify the mean output from the accepted law.

    Show the answer and reasoning

    The target normalizer is 1. Envelope C=3 gives acceptance X squared, overall acceptance 1/3, accepted density 3x squared, geometric mean proposal count 3 and mean output 3/4.

    With q(x)=1 on (0,1), h(x)=3x squared is nonnegative and its integral is Z=3 integral_0^1 x squared dx=1. It is already normalized, although the rejection construction can begin without assuming that. Because h(x)<=3q(x), a valid envelope constant is C=3. Draw X uniformly and an independent uniform V, and accept when V<=h(X)/(Cq(X))=X squared. No unknown normalizer is needed in that acceptance calculation. The total acceptance probability is integral_0^1 q(x)x squared dx=1/3=Z/C. For a measurable subset A of (0,1), the joint probability of acceptance and X in A is integral_A x squared dx. Dividing by 1/3 gives the accepted density 3x squared=h/Z. This establishes the complete output law, including that regions near zero remain possible even though they are accepted less often. Repeated independent attempts give P(K=k)=(2/3)^(k-1)(1/3) for k=1,2,... . The tail sum yields E K=sum_(k>=1)(2/3)^(k-1)=3. The accepted output mean is integral_0^1 x(3x squared) dx=3/4. Attempt count and accepted value can also be separated: P(K=k,output in A)=(2/3)^(k-1) integral_A x squared dx factors into the geometric mass and the accepted-law probability. The expected work counts rejected proposals as well as the final accepted one. A smaller proposed envelope would need to dominate 3x squared everywhere except a null set; simply clipping an exceeded ratio would change the accepted density. The continuous endpoints 0 and 1 have zero proposal mass and do not affect the law, but a discrete proposal must be analyzed with its actual probabilities. The finite expected count follows from the proven positive acceptance 1/3, not from a small observed number of attempts.

  6. Give a finite target, observable and proposal for which an uncovered target state makes the ordinary importance estimator biased or undefined. Then repair the proposal and derive the correct expectation.

    Show the answer and reasoning

    Take target probabilities (1/2,1/2), observable f=(0,1) and proposal q=(1,0). The observed ordinary importance output is always 0, missing the true mean 1/2. Repair to q_epsilon=(1-epsilon,epsilon), 0<epsilon<1; then output is 0 or 1/(2 epsilon), with expectation 1/2.

    Consider states 0 and 1, normalized target p=(1/2,1/2) and f(0)=0,f(1)=1. The target expectation is 1/2. If q=(1,0), every proposal is state 0, where the ordinary importance output f(X)p(X)/q(X) equals zero. Its expectation is therefore zero, which is biased for 1/2. Trying to assign the missing state a weight p(1)/q(1) would divide by zero; the state is never drawn, so that undefined formal weight cannot recover its missing contribution. For any 0<epsilon<1, change the proposal to q_epsilon=(1-epsilon,epsilon). Both target states are now covered. The weighted output is zero at state 0 and (1/2)/epsilon=1/(2 epsilon) at state 1. Its expectation is (1-epsilon) times 0+epsilon times 1/(2 epsilon)=1/2, exactly the target mean. The cancellation uses the actual proposal probability epsilon, so using the old or an approximate weight would require a different expectation calculation. The repaired second moment is epsilon [1/(2 epsilon)] squared=1/(4 epsilon), and the variance is 1/(4 epsilon)-1/4=(1-epsilon)/(4 epsilon). It is finite for each positive epsilon but can be very large when coverage is extremely weak. Thus support repair establishes unbiasedness, not automatically good precision or affordable relative error. Independent repetitions divide this variance by their actual count; the observed failure to visit state 1 in a finite run does not prove its probability or contribution is zero. For a particular signed integral the minimal support condition covers every state with nonzero p(x)f(x), while a proposal intended to estimate all target observables must cover the full target support. The chosen repair satisfies the stronger condition. Self-normalizing the original defective sample cannot invent the absent state either. This finite example exposes a mathematical support failure rather than a rounding issue that could be fixed by increasing the same uncovered-proposal sample count.

  7. For the integral of 2x-1 on (0, 1), derive the optimal absolute-integrand importance density and the resulting one-sample variance. Explain why zero integral does not imply a zero-variance estimator.

    Show the answer and reasoning

    The integral is 0, A=integral |2x-1| dx=1/2 and q*(x)=2|2x-1|. The output is -1/2 or 1/2 with equal probability, so the optimal one-sample variance is 1/4. Cancellation of the integral does not make either sign contribution vanish.

    Let f(x)=2x-1 on (0,1). Its signed integral is [x squared-x]_0^1=0, while its absolute integral is A=integral_0^(1/2)(1-2x) dx+integral_(1/2)^1(2x-1) dx=1/4+1/4=1/2. Among ordinary importance densities covering all nonzero contributions, Cauchy-Schwarz gives (integral |f|) squared<=(integral f squared/q)(integral q)=integral f squared/q. Equality requires q proportional to |f|, hence q*(x)=2|2x-1|. Its integral is one and its zero at x=1/2 is harmless because f vanishes there as well. Under q*, the ordinary weighted output is f(X)/q*(X)=sign(2X-1)/2 whenever X differs from 1/2. Either half interval receives probability 1/2 under q*, since its absolute-integrand mass is 1/4 before dividing by A. The output therefore equals -1/2 or 1/2 with equal probability. Its expectation is zero and its second moment is 1/4, giving variance 1/4. Assigning an arbitrary value to the zero-over-zero expression at x=1/2 does not change the law because that point has proposal probability zero. For any admissible ordinary importance density the variance is integral f squared/q minus the squared integral, so the Cauchy-Schwarz lower bound here is A squared-I squared=1/4. It is attained by q*. Uniform sampling instead has second moment integral_0^1(2x-1) squared dx=1/3, showing that the optimal density helps but leaves nonzero variance. A density proportional to f itself would be negative on half the interval and is not a probability law. The target integral vanishes through cancellation between positive and negative regions; it does not say that the integrand is zero almost everywhere. A one-sample support-covering importance estimator must still represent both signs, which creates the displayed fluctuation. The lower bound is for this class of ordinary single-proposal estimators, not for every conceivable estimator: a separately justified symmetry or paired construction could exploit cancellation differently. The zero result cannot justify deleting either signed region from the proposal support.

  8. For the two-state importance setup with proposal (1/2, 1/2), unnormalized target (1, 3), and f=(0, 1), derive the one-observation ratio estimator’s full distribution and compare its mean with the normalized target.

    Show the answer and reasoning

    The one-observation ratio is 0 or 1, each with probability 1/2. Its mean is 1/2, variance 1/4 and bias -1/4 relative to the target mean 3/4. The two unnormalized averages remain unbiased for their separate sums.

    The proposal q=(1/2,1/2) draws X=0 or 1 equally often in law. Target masses (1,3) normalize to probabilities (1/4,3/4), so the target expectation of f=(0,1) is 3/4. The full unnormalized importance weights are h/q=(2,6); their expected value is 4, the target normalizer, while the expected weighted numerator is 3. Both are finite and positive in the appropriate denominator sense. With one observation, the self-normalized estimator is [w(X)f(X)]/w(X)=f(X), since either possible weight is positive. Thus its full distribution assigns probability 1/2 to 0 and probability 1/2 to 1. Its expectation is 1/2 and its variance is (1/2)-(1/2) squared=1/4. The bias for the normalized target is 1/2-3/4=-1/4; its mean squared error is consequently 1/4+1/16=5/16. The single numerator is 0 or 6 with equal probabilities and expectation 3; the single denominator is 2 or 6 with expectation 4. The ratio of those expectations is indeed 3/4, but the numerator and denominator are dependent and expectation does not commute with division. Replacing both weights by the common-scale equivalents (1,3) changes neither the realized ratio nor this argument. No zero-weight or uncovered-state failure is involved. For many independent proposal observations, strong laws make the two averages approach their expected sums, so their ratio is consistent when the denominator has positive limiting mean. That separate limiting fact does not make this explicitly biased one-observation law unbiased. Likewise the normalized weight diagnostic for one positive observation equals one, which is the largest possible one-observation weight ESS, while the target-mean bias remains -1/4. Finite normalized bias and a weight-dispersion statistic answer different questions.

  9. Construct an iid rare-event example with all importance weights equal and effective sample size n, yet with a substantial chance of seeing no events. Derive that chance and the actual estimator variance.

    Show the answer and reasoning

    Fix a large n and let the target/proposal event probability be p=1/n, with all weights 1. ESS is exactly n, yet P(no event)=(1-1/n)^n, at least exp(-2) for n>=2. The empirical probability variance is (1-1/n)/n squared and its relative variance is 1-1/n.

    Choose a fixed integer n>=2 before sampling, use states ordinary/event with target probabilities (1-1/n,1/n), and take the proposal equal to that target. Draw n independent states. Every likelihood weight is exactly one, so the weight effective sample size (sum_i w_i) squared/sum_i w_i squared is n. For large chosen n the event is rare even though the weights are perfectly uniform. This is a fixed sampling problem at that n, rather than an adaptive change of the target during a run. No event is observed precisely when all n trials choose the ordinary state. Its exact probability is (1-1/n)^n. To give a nonasymptotic lower bound, use -log(1-u)=integral_0^u 1/(1-t) dt<=u/(1-u) for 0<u<1. With u=1/n this yields n log(1-1/n)>=-n/(n-1)>=-2, so the no-event probability is at least exp(-2). Thus it remains substantial despite the maximal possible weight ESS; the exact expression provides the sharper value for any specified n. For the empirical probability phat, Bernoulli variance gives Var(phat)=p(1-p)/n=(1-1/n)/n squared. Dividing by p squared=1/n squared leaves relative variance 1-1/n and relative standard deviation square root(1-1/n). These are population calculations for the actual iid law. On the no-event record the realized mean and empirical indicator variance are zero, yet the population variance just derived is strictly positive. Equal weights certify that this weight-dispersion diagnostic sees no imbalance; they do not certify small error for every observable. A rare-event indicator can remain poorly resolved when its expected count is only one. The example has no serial dependence or faulty importance support, so neither problem is needed to defeat an observable-error interpretation of ESS. An actual probability bound or an appropriate event-count analysis is required to make that further precision claim.

  10. For a normalized finite target p, arbitrary proposal q0 and defensive fraction delta in (0, 1], derive the exact maximum importance-weight bound for q=(1-delta)q0+delta p and a second-moment bound for a square-integrable observable. State what sampling access the mixture requires.

    Show the answer and reasoning

    On target-positive states, w(x)=1/[delta+(1-delta)q0(x)/p(x)], so its exact maximum is 1/[delta+(1-delta) min(q0/p)]<=1/delta. Also E_q[(wf) squared]<=delta^(-1)E_p[f squared]. Drawing the defensive mixture requires actual sampling access to normalized p.

    Let p be a normalized finite target, q0 any proposal probability and 0<delta<=1. Define q=(1-delta)q0+delta p. Whenever p(x)>0, q(x)>=delta p(x)>0, so the importance ratio is w(x)=p(x)/q(x)=1/[delta+(1-delta)q0(x)/p(x)]. Taking the minimum of q0/p over the finite target-positive support gives the stated exact maximum. It is at most 1/delta. For delta<1 this universal upper bound is attained when some target-positive state has q0(x)=0; otherwise the exact maximum may be strictly smaller. At delta=1 every target-positive weight is one. At a state with p(x)=0 and q(x)>0 define w(x)=0; if q(x)=0 the state is never sampled and its ratio need not be evaluated. For any target-square-integrable observable f, the support inclusion makes E_q[w f]=sum_x p(x)f(x)=mu. Its second moment is sum_(p(x)>0) p(x) squared f(x) squared/q(x), bounded by delta^(-1)sum_x p(x)f(x) squared. Consequently Var_q(wf)<=delta^(-1)E_p f squared-mu squared. This is a mathematical population bound, not a substitute for an actual finite-run confidence argument. To sample q literally, first draw a Bernoulli branch with probability delta for the p component and otherwise use q0, then draw exactly from the chosen component. Thus the defense assumes an actual target sampler as well as correct evaluation of the normalized mixture probabilities used in the weight. Knowing an unnormalized target formula does not by itself provide either access. If that target sampler is already available, direct target sampling is also a relevant baseline; the defensive construction does not make its cost disappear. The bound prevents arbitrarily large weights caused by a hole in q0, but a small defensive fraction can still make the upper bound and second-moment cost large. Good performance for a particular observable needs its actual variance and work considered together. A different accessible reference component r can provide an analogous guarantee only when a proven domination p<=K r supplies the corresponding constant. The declared mixture, support and sampling access cannot be inferred from a favorable empirical weight histogram.

  11. For f(u)=(u-1/2) squared and antithetic transformation 1-u, derive the pair covariance and compare estimator variance with two independent evaluations. Explain why invariance of the transformation alone does not guarantee a gain.

    Show the answer and reasoning

    Reflection leaves f unchanged. Its mean is 1/12 and variance 1/180, so pair covariance is 1/180 and the antithetic average has variance 1/180. Two independent evaluations have average variance 1/360; the declared two-evaluation antithetic scheme is twice as variable.

    For U uniform on (0,1), set f(U)=(U-1/2) squared. Reflection gives f(1-U)=(1/2-U) squared=f(U) exactly. The reflected input still has the uniform law, so both evaluations have the correct marginal distribution, but their outputs are identical. Their covariance is therefore the full marginal variance rather than a negative quantity. Writing v=U-1/2 makes v uniform on (-1/2,1/2). Direct integration gives E f=integral_(-1/2)^(1/2) v squared dv=1/12 and E f squared=integral_(-1/2)^(1/2) v to the fourth dv=1/80. Thus Var(f)=1/80-1/144=1/180, and Cov(f(U),f(1-U))=1/180. These nonzero moments rule out a misleading claim that reflection cancellation makes this even observable exact. The pair average [f(U)+f(1-U)]/2 is just f(U), with variance 1/180. In contrast two independent evaluations have average variance [2(1/180)]/4=1/360. With m independent reflected pairs, the antithetic average has variance 1/(180m), whereas 2m independent evaluations have variance 1/(360m). Under the stated cost of two function evaluations per pair, the reflected scheme is twice as variable. If an implementation recognizes the exact equality and skips the second evaluation, its work accounting changes and must be stated separately. Measure preservation of a transformation ensures the reflected marginal is correct and hence the pair average is unbiased. It does not determine the covariance sign. A monotone uniform-input function has the familiar negative reflection covariance, but this function decreases and then increases symmetrically around its midpoint. The same reflection reinforces rather than offsets its fluctuation. Equal-cost variance analysis must therefore use the actual observable and coupling, not the name antithetic alone.

  12. For independent uniform X,Y on (0,1), estimate the probability X+Y>3/2. Derive the direct Bernoulli variance and the conditional estimator obtained by integrating Y, including its exact variance and variance-reduction factor.

    Show the answer and reasoning

    The event probability is 1/8 and direct Bernoulli variance is 7/64. Conditioning gives H(X)=max(X-1/2,0), with mean 1/8 and variance 5/192. At the same independent-output count the variance improvement factor is 21/5.

    For X=x in (0,1), the event X+Y>3/2 requires Y>3/2-x. If x<=1/2 this has probability zero; if x>1/2 the uniform Y tail probability is x-1/2. Thus the exact conditional expectation of the direct indicator B is H(x)=max(x-1/2,0). Integrating over X gives p=E H=integral_(1/2)^1(x-1/2) dx=1/8. The direct indicator is Bernoulli with variance p(1-p)=(1/8)(7/8)=7/64. The conditional estimator draws only X and reports H(X). Its second moment is integral_(1/2)^1(x-1/2) squared dx=(1/2) cubed/3=1/24. Subtracting the squared mean gives Var(H)=1/24-1/64=5/192. The threshold equality at x=1/2 contributes no event probability and no integration ambiguity under the continuous law. This exact conditional tail replaces random variation in Y without changing the expectation. For n independent output replicates, direct sampling has variance 7/(64n) and conditioning has variance 5/(192n). Their ratio is (7/64)/(5/192)=21/5. The total-variance identity also checks the reduction: E Var(B|X)=E[H(1-H)]=1/8-1/24=1/12, and adding Var(H)=5/192 returns 7/64. The eliminated conditional noise is a real mathematical variance component, not a difference caused by changing the target event. The comparison above uses the same number of independent estimator outputs. Direct outputs use both X and Y, while conditional outputs use an analytic tail calculation and one X, so an equal-work comparison must account for those costs rather than assuming them identical. If the conditional tail were only approximated numerically, its error would require a separate bias bound. Replacing the conditional expectation by a guessed threshold probability would not retain the exact unbiasedness and variance just proved.

  13. For f(x)=x and n equal strata, derive the exact variance of the independent-jitter average and compare with n iid uniform observations. State why a deterministic midpoint average has no random standard error under this model.

    Show the answer and reasoning

    Independent jitter gives mean 1/2 and variance 1/(12n cubed), versus 1/(12n) for iid uniform sampling: a factor n squared improvement. The deterministic midpoint average is exactly 1/2 for this linear integrand and has no random sampling standard error under the declared fixed rule.

    Index the n equal cells by j=0,...,n-1, and draw independent V_j uniform on (0,1). The jittered point in cell j is X_j=(j+V_j)/n. Its conditional-cell mean is (j+1/2)/n and variance 1/(12n squared). The equally weighted estimate A=(1/n)sum_j X_j therefore has mean [sum_j(j+1/2)]/n squared=1/2. Each stratum contributes its exact mass 1/n, so the different cell means are weighted correctly. The independent jitters give no cross-cell covariance. Thus Var(A)=(1/n squared)sum_j 1/(12n squared)=1/(12n cubed). Equivalently A=(n-1)/(2n)+(1/n squared)sum_j V_j, which gives the same variance directly. An average of n iid uniform observations has variance 1/(12n), making the equal-count improvement factor n squared. At n=1 the two stochastic constructions agree and the factor is one. The deterministic midpoint rule takes x_j=(j+1/2)/n with no random V_j. Its average for f(x)=x is exactly 1/2 by the same arithmetic sum. There is no sampling law generating independent within-cell observations under that fixed rule, so an iid standard-error formula attached to its n distinct values would have no justification. One can regard a fixed result as a degenerate random variable with variance zero, but that merely states absence of random sampling noise, not a general quadrature-error guarantee. For this linear integrand the midpoint error is known to be zero through the exact algebra. Other nonlinear or irregular observables need their own deterministic error bound; the absence of randomness does not remove their possible bias. Likewise the jitter variance above depends on independent uniforms within their actual cells. A common shift or reused jitter would create a different covariance structure and would not inherit the same n-cubed variance formula automatically.

  14. For two equally weighted states with a proposal that always flips, derive the Metropolis kernel, invariant distribution and alternating time law. Explain why invariance is insufficient for convergence from every initial state and how half-laziness changes the chain.

    Show the answer and reasoning

    The always-flip Metropolis kernel is [[0,1],[1,0]], with invariant law (1/2,1/2). From law (a,1-a) it alternates between that law and (1-a,a). Half-laziness gives both rows (1/2,1/2), reaching the invariant law after one step from every start.

    Both target masses are equal and the proposal always chooses the other state, with the same reverse probability. The Metropolis ratio is one, so every proposed flip is accepted. The resulting kernel K has K01=K10=1 and both diagonal entries zero. Detailed balance holds because each directed target flow is 1/2. The stationary equations pi0=pi1 and pi0+pi1=1 give the invariant law (1/2,1/2). From an initial probability row mu=(a,1-a), one transition swaps its entries and two transitions return them. Hence the time-n law is mu for even n and (1-a,a) for odd n. A point start alternates deterministically, and the law fails to converge unless a=1/2. The kernel is irreducible but has period two, with eigenvalues 1 and -1. Stationarity for the invariant initial law and convergence from arbitrary initial laws are therefore different statements. Half-laziness uses K_lazy=(I+K)/2, with a separate probability 1/2 of retaining the current state. Both rows become (1/2,1/2), so mu K_lazy=(1/2,1/2) for every mu and all later marginals stay there. Its positive self-loop gives period one and its second eigenvalue is zero. In this particular reset kernel the conditional law of the next state is the same uniform law regardless of the whole past, so states from the first reset onward are independent uniforms under the usual fresh transition randomness. The original alternating chain can still have time averages tending to the equally weighted mean, because its two states are visited almost equally often. That does not repair its nonconvergent point-start single-time law. Nor does the special one-step reset calculation say that half-laziness mixes every other chain in one step. Invariance, periodicity, ordinary convergence and precision of time averages each require the corresponding actual kernel argument.

  15. For H(x,p)=(x squared+p squared)/2 in one dimension, derive one leapfrog step, its determinant, and reversibility after momentum flip. Explain why the acceptance correction preserves the target even when the uncorrected step does not conserve energy exactly.

    Show the answer and reasoning

    Let a=1-h squared/2. One leapfrog step maps (x,p) to (a x+h p,-h(1-h squared/4)x+a p), with determinant 1. With R(x,p)=(x,-p), RLR=L inverse and T=RL is a volume-preserving involution. Accepting Tz with min(1,exp(H(z)-H(Tz))) preserves the Gaussian phase target despite energy error.

    For H(x,p)=(x squared+p squared)/2 and step size h, the half kick is p_half=p-(h/2)x. The drift gives x_new=x+h p_half=(1-h squared/2)x+h p. The final kick gives p_new=p_half-(h/2)x_new=-h(1-h squared/4)x+(1-h squared/2)p. Writing a=1-h squared/2, the matrix is L=[[a,h],[-h(1-h squared/4),a]]. Its determinant is a squared+h squared (1-h squared/4)=1, so it is invertible and preserves phase-space volume. Momentum flip is R=diag(1,-1). Multiplication gives RLR=[[a,-h],[h(1-h squared/4),a]], exactly the inverse of the determinant-one matrix L. Therefore T=RL satisfies T squared=RLRL=identity, with absolute determinant one. The proposal used for the simple deterministic Metropolis balance proof is this reflected map T. Neither the inversion nor the volume calculation requires pretending that leapfrog is the exact harmonic-oscillator rotation. Energy is not exactly conserved in general. Starting at z=(0,1), the step gives Lz=(h,a), so H(Lz)=(h squared+a squared)/2=1/2+h to the fourth/8, while H(z)=1/2. Momentum reflection leaves H unchanged, hence the same difference occurs for Tz. For h different from zero it is strictly positive in this example. At h=0 the map reduces to its direct identity/reflection branch and the energy error vanishes. The normalized phase density is proportional to exp(-H). For a(z)=min(1,exp(H(z)-H(Tz))), the accepted flow density rho(z)a(z)=min(rho(z),rho(Tz)) is unchanged by the involution T. Changing variables through its unit-volume map shows accepted inflow equals accepted outflow; adding rejection at the original state proves invariance. Fresh independent standard-normal momentum preserves the joint Gaussian law and yields the desired standard-normal position marginal. This exact acceptance correction does not prove rapid mixing, numerical stability or invariance for an arbitrary state-dependent step rule.

  16. Given two particle values with normalized weights 1/4 and 3/4, derive the conditional expectation and variance of their equally weighted empirical mean after N independent categorical resamples. Explain what remains unbiased conditional on the original values and what additional target claim does not follow.

    Show the answer and reasoning

    For original scalar values v0,v1, the resampled mean has conditional mean (v0+3v1)/4 and variance 3(v1-v0) squared/(16N). It is unbiased for the original weighted empirical mean; it need not be unbiased for an external target mean.

    Condition on the original values v0,v1 and weights (1/4,3/4). Each categorical resample can be written Y_j=v0+(v1-v0)B_j, where B_j is Bernoulli with probability 3/4. Under the stated independent conditional resampling, B_1,...,B_N are iid given the original information. Thus E[Y_j|original]=(1/4)v0+(3/4)v1, while Var(Y_j|original)=(v1-v0) squared (3/4)(1/4)=3(v1-v0) squared/16. For the equally weighted empirical mean A_N=(1/N)sum_j Y_j, conditional expectation retains the same weighted mean m=(v0+3v1)/4 and conditional variance divides by N, giving 3(v1-v0) squared/(16N). The full conditional law is A_N=v0+(v1-v0)K/N with K binomial(N,3/4). If the values coincide, these possible expressions collapse to the same constant and the variance formula becomes zero directly. N must be a positive integer; an empty empirical mean is not defined. The exact unbiasedness claim is E[A_N|original]=m. If the original values and weights are themselves random, taking expectations gives E A_N=E m. It does not replace E m by a desired physical or filtering mean without a further proof. The law of total variance also gives Var(A_N)=Var(m)+E[3(v1-v0) squared/(16N)] when the moments exist: resampling preserves the conditional mean while adding its own sampling fluctuation. Repeated values after resampling are allowed; conditional independence concerns the categorical draws, not a requirement that their realized labels differ. Unconditional outputs may share dependence through the original random particle set. The calculation therefore justifies a finite empirical resampling identity and its exact conditional variance. It does not certify the original weighted empirical measure as an unbiased normalized posterior, nor turn all particle descendants into independent target draws.

  17. For X uniform on (0, theta) and observable 1, compare the true derivative of E[1] with the naive interior density-score calculation. Derive the missing boundary contribution and state the fixed-support hypothesis that failed.

    Show the answer and reasoning

    E_theta[1]=1 has derivative 0. The interior score is -1/theta, whose expectation is -1/theta. Leibniz differentiation adds the moving-upper-boundary contribution 1/theta, canceling it. The naive fixed-support score identity omitted this boundary mass.

    For theta>0 the uniform density is p_theta(x)=1/theta on 0<x<theta. Its integral is one, so the expectation of the constant observable 1 is exactly one at every theta and its derivative is zero. At an interior point the derivative of log p_theta(x) is -1/theta. Averaging that interior score under the current uniform law yields -1/theta, which disagrees with the true derivative. Normalization alone did not justify differentiating the density only inside its moving support. Leibniz differentiation makes the missing term explicit: d/dtheta integral_0^theta (1/theta) dx=integral_0^theta (-1/theta squared) dx+(1/theta) times 1=-1/theta+1/theta=0. The second term is the contribution of the upper endpoint moving with speed one. The lower endpoint is fixed and contributes no derivative. For the constant observable the two terms cancel exactly, as normalization requires. The usual score proof assumes one common fixed support and conditions permitting differentiation under that fixed integral, such as almost-everywhere differentiability throughout a parameter neighborhood with an integrable bound for the density derivative. Extending this uniform density by zero outside its interval does not restore those conditions: changes in the indicator near the moving endpoint produce a boundary contribution, and their difference quotients have no suitable common integrable domination. A pointwise interior derivative cannot account for that changing region. A common-input representation X=theta U, with U uniform on (0,1), instead makes the implemented constant payoff identically one for all theta and its path derivative zero, agreeing with the target. More general moving-boundary sensitivities can include legitimate boundary terms, but they need the corresponding differentiation argument. This example refutes the naive interior-score calculation, rather than claiming that every sensitivity involving moving support is impossible.

  18. Suppose telescoping increments have L2 norms bounded by C*2^(-beta*l/2), level work is bounded by K*2^(gamma*l), and an independent truncation has survival probability 2^(-r*l). Prove sufficient conditions for an unbiased finite-variance estimator with finite expected work, and state when the interval of feasible r is nonempty.

    Show the answer and reasoning

    With Y0 in L2, beta>0, nonnegative work-growth exponent gamma and an independent finite truncation, gamma<r<beta is sufficient. The weighted series is unbiased, its L2 norm is bounded by ||Y0||_2+C*sum_(l>=1)2^(-(beta-r)l/2), and expected work is bounded by the base cost+K*sum_(l>=1)2^(-(r-gamma)l). The window is nonempty when beta>gamma.

    Let Delta_l be the coupled telescoping increments and assume Y0 is in L2. For beta>0, E|Delta_l|<=||Delta_l||_2<=C*2^(-beta l/2) is summable. Thus mu=E Y0+sum_(l>=1)E Delta_l is finite and equals the limiting approximation expectation when those expectations telescope. Choose r>0 and an independent integer T with P(T>=l)=p_l=2^(-r l); these decreasing survivals tend to zero and define a finite T almost surely. Set Z=Y0+sum_(l=1)^T Delta_l/p_l. Independence of T from the entire increment construction gives E[|Delta_l|1_(T>=l)/p_l]=E|Delta_l|. The sum of these expectations is finite, so Tonelli and then Fubini justify the survival-weight cancellation E Z=E Y0+sum_l E Delta_l=mu. This is a proof of unbiasedness for the actual finite random sum. It does not assume independence of different increments, and it does not exchange a merely conditionally convergent signed series without an absolute-expectation argument. The L2 norm of one weighted term is ||Delta_l||_2/square root(p_l), at most C*2^(-(beta-r)l/2). If r<beta, their norms are summable, so Minkowski makes the partial sums converge in L2 and bounds ||Z||_2 by ||Y0||_2 plus that geometric series. In particular Z has finite second moment and variance. With nonnegative level work bounded by K*2^(gamma l), its expected total work is at most the base expected cost+K*sum_(l>=1)p_l*2^(gamma l). This second geometric series converges when r>gamma. For the usual gamma>=0 case, gamma<r<beta simultaneously ensures r>0, finite expected work and the stated sufficient finite-variance condition. Such an interval exists exactly when beta>gamma under these bounds. If gamma<0, the same reasoning instead permits any 0<r<beta, since r>gamma then holds automatically. At equality endpoints these sufficient geometric-series arguments do not converge; that does not prove impossibility for every better-correlated or faster-decaying actual construction. A hard unweighted truncation or a T selected after inspecting increments would no longer satisfy the independent survival-weight proof, and finite expected cost does not impose a deterministic runtime cap.

What to carry forward

  • An unbiased estimate, a consistent estimate, an asymptotic error bar and a finite-sample certificate use different assumptions.
  • The chance of seeing no hits is an exact binomial calculation. It gives a nonzero upper confidence bound whenever observation is finite and the requested confidence is strict.
  • An importance proposal must cover relevant target contributions. Normalizing random weights changes the sampling law of the estimator.
  • Variance comparisons require an observable, a coupling and a cost. Strata, paired inputs, controls and conditional expectations use different information.
  • An invariant MCMC kernel needs a separate convergence argument. Weighted ESS and serial-correlation ESS answer different questions.
  • Particle normalization and level telescoping are identities for particular unnormalized targets. Conditional sampling, independence and rounding determine the guarantees that follow.
  • An unbiased score or pathwise sensitivity requires justified differentiation. Random truncation requires both a moment bound and a work bound.
  • Repeated inspection needs simultaneous coverage. State how model discrepancy, numerical approximation and stochastic error enter the final bound.

References

Sources for the concepts and teaching approaches in this article.

  1. Art B. Owen3 sources
    1. Inverting a distribution with a uniform variableArt B. OwenPrimary · PDFartowen.su.domainsRead source
    2. Variance reduction at a stated evaluation budgetArt B. OwenPrimary · PDFartowen.su.domainsRead source
    3. Star discrepancy and bounded variationArt B. OwenPrimary · PDFartowen.su.domainsRead source
  2. Constructing an alias tableLuc DevroyePrimary · PDFluc.devroye.orgRead source
  3. Importance weighting and defensive mixture samplingTim HesterbergPrimary · PDFstat.cmu.eduRead source
  4. Random shifts and lattice frequenciesChristiane Lemieux and Pierre L’EcuyerPrimary · PDFinforms-sim.orgRead source
  5. Volume-preserving Hamiltonian proposalsRadford M. NealPrimaryarxiv.orgRead source
  6. Regenerative cycle rewards and residualsPeter W. Glynn and Ward WhittPrimary · PDFcolumbia.eduRead source
  7. Feynman–Kac measures and particle resamplingPierre Del Moral, Arnaud Doucet and Ajay JasraPrimary · PDFstats.ox.ac.ukRead source
  8. Coupled level corrections and multilevel complexityMichael B. GilesPrimary · PDFpeople.maths.ox.ac.ukRead source
  9. Likelihood ratios and differentiation of expectationsPeter W. Glynn and Mariana Olvera-CraviotoPrimaryarxiv.orgRead source
  10. Survival weights for randomized truncationChang-han Rhee and Peter W. GlynnPrimaryarxiv.orgRead source
  11. Constructing a stationary target with Metropolis transitionsDavid A. Levin and Yuval PeresPrimary · PDFpages.uoregon.eduRead source
  12. Nonnegative supermartingales and time-uniform boundsSteven R. Howard, Aaditya Ramdas, Jon McAuliffe and Jasjeet SekhonPrimaryarxiv.orgRead source
  13. A maximum inequality with its integrability proofRick DurrettPrimary · PDFsites.math.duke.eduRead source