From posterior treatment probabilities to weight distributions
A treatment model rarely determines a single known probability for each person. Its parameters are estimated from data, and a Bayesian analysis represents uncertainty about those parameters with a posterior distribution. Each posterior draw therefore gives a different set of fitted treatment probabilities—and, after inversion, a different set of weights. Looking at that distribution is more informative than reporting only weights calculated from one fitted probability vector.
The focus here is a binary treatment \(A_i\in\{0,1\}\), with measured pre-treatment covariates \(L_i\), for individuals \(i=1,\ldots,n\). Let \(D\) denote the observed data used to fit a treatment model, and let \(\theta\) denote its parameter. The model specifies \(e_i(\theta)=P(A_i=1\mid L_i,\theta)\). For posterior draw \(\theta^{(m)}\), write \(e_i^{(m)}=e_i(\theta^{(m)})\). The probability of the treatment actually received is \(e_i^{(m)}\) if \(A_i=1\), and \(1-e_i^{(m)}\) if \(A_i=0\).
For a treatment with more than two categories, the same principle applies: for each draw, use the model probability assigned to the category that person received, then take its reciprocal. This tutorial concentrates on the binary case. The weights here are unstabilized; any numerator used in a different weighting scheme must be specified and applied consistently to each draw.
The posterior distribution of a weight is not a distribution of treatment assignments. The observed treatment \(A_i\) is fixed in the calculation; uncertainty comes from the posterior uncertainty in the fitted treatment mechanism. Also, all individuals’ weights in a given draw share the same sampled model parameters, so their posterior variation is generally dependent.
How posterior uncertainty changes the weight
In general, averaging fitted probabilities and then taking a reciprocal does not give the posterior mean weight. Inversion is nonlinear, and a small-probability tail can have a large effect after inversion.
Proof. The function \(g(p)=1/p\) is strictly convex on \(p>0\), since \(g''(p)=2/p^3>0\). Jensen’s inequality gives \(g(E[P])\leq E[g(P)]\), which is the stated inequality. Strict convexity makes the inequality strict unless \(P\) is constant almost surely. \(\square\)
For an observed treated person, apply the result to the posterior distribution of \(e_i\). For an untreated person, apply it to \(1-e_i\), which is also a random probability. Thus the reciprocal of a posterior mean probability generally understates the posterior mean inverse probability. More importantly, it hides the spread and upper tail of the weight distribution.
Worked Example: A Beta Posterior and an Inverse Weight
Suppose a treatment probability \(e\) is common across individuals in a simple model. Assign \(e\sim\operatorname{Beta}(2,2)\), and observe treatment for 8 of 10 individuals. The binomial likelihood gives the posterior \(e\mid D\sim\operatorname{Beta}(10,4)\). For an individual who received treatment, the draw-specific weight is \(W=1/e\).
The posterior mean probability is \(E[e\mid D]=10/(10+4)=5/7\), so taking the reciprocal of that mean gives \(7/5=1.4\). But for \(e\sim\operatorname{Beta}(a,b)\), when \(a>1\), $$ E[1/e]=\frac{B(a-1,b)}{B(a,b)} =\frac{a+b-1}{a-1}. $$ For \(a=10,b=4\), this is \(13/9\approx1.444\), not \(1.4\).
The difference is not a rounding error: it is the effect of averaging after a nonlinear transformation. Here the posterior variance also exists because \(a>2\). Using the corresponding second moment, \(E[1/e^2]=(a+b-1)(a+b-2)/[(a-1)(a-2)]\), gives \(E[1/e^2]=13\cdot12/(9\cdot8)=13/6\). Therefore \(\operatorname{Var}(W\mid D)=13/6-(13/9)^2=13/162\approx0.0802\).
The moment formulas follow directly from the Beta density. For \(a,b>0\), that density is \(p^{a-1}(1-p)^{b-1}/B(a,b)\) on \(0<p<1\), where \(B(a,b)=\int_0^1p^{a-1}(1-p)^{b-1}\,dp\). Hence, for \(a>1\), $$ E[1/P]=\frac{1}{B(a,b)} \int_0^1p^{a-2}(1-p)^{b-1}\,dp =\frac{B(a-1,b)}{B(a,b)} =\frac{a+b-1}{a-1}. $$ The last equality uses \(B(a,b)=\Gamma(a)\Gamma(b)/\Gamma(a+b)\) and \(\Gamma(x+1)=x\Gamma(x)\). Replacing \(1/P\) by \(1/P^2\) gives the stated second moment when \(a>2\). These conditions matter: a posterior may be proper while a posterior inverse-weight moment is infinite.
Summarizing weights across posterior draws
With \(M\) posterior draws, calculate \(W_i^{(m)}\) separately for every individual and draw. Useful summaries include posterior medians and quantiles for each person’s weight, the maximum weight in each draw, and weight-distribution summaries such as the effective sample size. These describe different features: an individual-level interval shows uncertainty for one weight, while a draw-level maximum or effective sample size describes the combined set of weights.
For nonzero nonnegative weights, \(1\leq\operatorname{ESS}\leq n\). To see the upper bound, Cauchy–Schwarz gives \((\sum_i w_i)^2\leq n\sum_iw_i^2\). For the lower bound, expand \((\sum_iw_i)^2=\sum_iw_i^2+2\sum_{i<j}w_iw_j\geq\sum_iw_i^2\). Dividing by the positive sum of squares proves both bounds. Equal weights give ESS \(n\); concentration of weight on one individual gives ESS 1. Thus a posterior distribution of ESS can reveal how uncertain the concentration of weights is, but ESS is a diagnostic summary, not a literal count of independent observations or a guarantee of causal validity.
Worked Example: Two Posterior Draws and Their Effective Sample Sizes
Suppose three individuals have observed-treatment probabilities \((0.20,0.30,0.80)\) in posterior draw 1. Their weights are \((5,1/0.30,1.25)\), or approximately \((5,3.333,1.25)\). The sum is \(9.5833\), and the sum of squared weights is \(5^2+(1/0.30)^2+1.25^2=25+11.1111+1.5625=37.6736\). Therefore \(\operatorname{ESS}^{(1)}=9.5833^2/37.6736\approx2.438\).
In posterior draw 2, suppose the observed-treatment probabilities are \((0.40,0.50,0.60)\). The weights are \((2.5,2,1.6667)\). Their sum is \(6.1667\), and their squared sum is \(2.5^2+2^2+(1/0.60)^2=6.25+4+2.7778=13.0278\). Thus \(\operatorname{ESS}^{(2)}=6.1667^2/13.0278\approx2.919\).
The second draw has a larger ESS, meaning its weights are less concentrated by this measure. Neither draw has equal weights, so neither ESS reaches 3. The posterior distribution of ESS across many draws would show whether this contrast is typical or whether these two draws are unusual.
Worked Example: A Small Probability Tail and a Large Weight
For a treated individual, suppose four representative posterior draws of the treatment probability are \(0.10,0.20,0.50,\) and \(0.80\). The corresponding weights are \(10,5,2,\) and \(1.25\). Their mean is \((10+5+2+1.25)/4=4.5625\), while their median is \((5+2)/2=3.5\).
The lowest probability draw produces the largest weight, 10, and contributes more than half of the total weight in these four values: \(10/18.25\approx0.548\). Reporting only the median would not communicate this upper tail. In an actual analysis, inspect quantiles and the largest weights over the full posterior simulation, and identify which individuals and covariate patterns generate the extremes.
Conditions, diagnostics, and limitations
A Bayesian treatment model needs a well-defined likelihood and a proper posterior for the parameter draws being used. To calculate finite draw-specific weights, the probability assigned to each observed treatment must be strictly positive in every draw used. For a causal interpretation of inverse-probability weighting, additional assumptions are needed: consistency, conditional exchangeability given the measured pre-treatment covariates, and positivity for treatment levels relevant to the target population. A posterior distribution does not make these assumptions true.
Diagnostics should examine the probability scale and the weight scale. Check whether posterior draws converge and mix adequately, using appropriate chain diagnostics and trace plots; autocorrelated simulation output should not be mistaken for many independent posterior draws. Then inspect the posterior distribution of small observed-treatment probabilities, upper weight quantiles, maxima, and ESS. A handful of extreme weights may signal weak overlap, a sparse covariate pattern, or model sensitivity. They can dominate weighted analyses even when the posterior mean probability appears unremarkable.
A fitted model that never produces probabilities near zero in the observed data is not necessarily evidence of adequate overlap: model form, prior choice, and covariate support matter. Conversely, an inverse weight can have a very long or even infinite posterior tail when the posterior gives sufficient mass near zero. Finite Monte Carlo summaries do not establish that the corresponding theoretical posterior moment is finite.
The main alternative summaries answer different questions. A plug-in analysis uses one fitted probability vector and produces one set of weights; it is simple but omits parameter uncertainty. Averaging posterior probabilities before inversion also gives a single set, but Jensen’s inequality shows why it generally differs from the posterior mean weight and why it obscures the tails. Posterior draw-by-draw weighting preserves the model’s parameter uncertainty in the weight distribution. It still does not account automatically for model misspecification, unmeasured confounding, or uncertainty from every later stage of a causal analysis. A posterior distribution of weights alone is not a posterior distribution for a causal effect.
Common mistake
Wrong reasoning: “The posterior mean treatment probability is 0.5, so the posterior mean weight for a treated person is \(1/0.5=2\).”
Correction: The posterior mean weight is \(E[1/e\mid D]\), not \(1/E[e\mid D]\). Inversion is nonlinear; by Jensen’s inequality, \(E[1/e\mid D]\geq1/E[e\mid D]\) when the expectation exists. Calculate the reciprocal separately for every posterior draw, then summarize those transformed draws. Also inspect the tail: the posterior mean alone may not convey weight instability.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For an untreated person with posterior treatment probability draws \(0.2\) and \(0.4\), what are the two draw-specific weights?
- Why can \(1/E[e\mid D]\) not generally replace \(E[1/e\mid D]\) for a treated person?
- For weights \((1,1,1)\), calculate ESS. What does it become for weights \((3,0,0)\)?
- Does a proper posterior for a treatment model guarantee a finite posterior mean inverse weight? Explain.
- Name one causal assumption that posterior treatment-model draws do not establish.
Solutions. (1) The person is untreated, so the weights are \(1/(1-0.2)=1.25\) and \(1/(1-0.4)=1/0.6\approx1.667\). (2) Reciprocal is nonlinear and convex on positive probabilities; Jensen’s inequality gives \(E[1/e\mid D]\geq1/E[e\mid D]\), with equality only if \(e\) is constant under the posterior. (3) Equal weights give \(3^2/(1+1+1)=3\). For \((3,0,0)\), ESS is \(9/9=1\). (4) No. A posterior can be proper while placing enough mass near zero that the inverse-probability expectation diverges. (5) For example, conditional exchangeability, consistency, or positivity requires substantive assumptions and is not proved by posterior computation.