NLA-lib Explorer

ProbabilityTheory.hasLaw_sum_sq_of_hasLaw_pi_gaussianReal

Library · theorem

The chi-square law, HasLaw form: if \mathbf{g} = (\mathbf{g}_i)_{i \in \iota} has independent standard normal coordinates (law the product of gaussianReal 0 1) and \iota is nonempty, then \sum_i \mathbf{g}_i^2 has law \mathrm{Gamma}(d/2, 1/2) with d = \lvert\iota\rvert, the chi-square law with d degrees of freedom.

ProbabilityTheory.hasLaw_sum_sq_of_hasLaw_pi_gaussianReal.{u_2, u_3} {Ω : Type u_2}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {ι : Type u_3} [Fintype ι] [Nonempty ι] {g : Ω → ι → ℝ}
  (hg : HasLaw g (Measure.pi fun x ↦ gaussianReal 0 1) μ) :
  HasLaw (fun ω ↦ ∑ i, g ω i ^ 2) (gammaMeasure (↑(Fintype.card ι) / 2) (1 / 2)) μ

Full source on GitHub

Import NLAlib.ForMathlib.Probability.Distributions.ChiSquared.