Documentation

CslibFrontier.Foundations.Probability.Gaussian.Stein

Gaussian integration by parts #

Stein's lemma: for a real Gaussian x ∼ N(μ, v) and a differentiable f with f, (x - μ) f and f' integrable, E[(x - μ) f x] = v E[f' x] (integral_sub_mul_gaussianReal). For v ≠ 0 this is integration by parts on the line against the density φ, whose derivative is φ' x = -((x - μ) / v) φ x (hasDerivAt_gaussianPDFReal); for v = 0 both sides vanish. Every polynomial is integrable under a real Gaussian (integrable_eval_gaussianReal), so the lemma applies to all polynomials (integral_sub_mul_eval_gaussianReal); this is the computation behind the Hermite polynomials of O'Donnell, §11.2.

Main results #

References #

A function is integrable against a nondegenerate real Gaussian iff its product with the density is Lebesgue integrable.

theorem ProbabilityTheory.hasDerivAt_gaussianPDFReal (μ : ℝ) (v : NNReal) (x : ℝ) :
HasDerivAt (gaussianPDFReal μ v) (-((x - μ) / ↑v) * gaussianPDFReal μ v x) x

The derivative of the density of N(μ, v) is φ' x = -((x - μ) / v) φ x. For v = 0 the density is 0 and both sides vanish.

theorem ProbabilityTheory.integral_sub_mul_gaussianReal {μ : ℝ} {v : NNReal} {f f' : ℝ → ℝ} (hf : ∀ (x : ℝ), HasDerivAt f (f' x) x) (hfi : MeasureTheory.Integrable f (gaussianReal μ v)) (hxf : MeasureTheory.Integrable (fun (x : ℝ) => (x - μ) * f x) (gaussianReal μ v)) (hf' : MeasureTheory.Integrable f' (gaussianReal μ v)) :
∫ (x : ℝ), (x - μ) * f x ∂gaussianReal μ v = ↑v * ∫ (x : ℝ), f' x ∂gaussianReal μ v

Stein's lemma (Gaussian integration by parts): for x ∼ N(μ, v) and a differentiable f with f, (x - μ) f and f' integrable, E[(x - μ) f x] = v E[f' x].

Every polynomial is integrable under a real Gaussian, since its moment generating function is finite everywhere.

Stein's lemma for polynomials: for x ∼ N(μ, v) and a real polynomial p, E[(x - μ) p x] = v E[p' x].