Documentation

TauCeti.Probability.Distributions.Gamma.Sqrt

Square roots of gamma variables #

A positive variable whose square is gamma has a density of its own: substituting x = t ^ 2 in the gamma density and multiplying by the Jacobian 2 * t turns r ^ a / Γ a * x ^ (a - 1) * exp (-(r * x)) into 2 * r ^ a / Γ a * t ^ (2 * a - 1) * exp (-(r * t ^ 2)) on the positive half-line. This file proves that correspondence in both directions: squaring carries the latter law to gammaMeasure, and taking square roots carries gammaMeasure back.

At shape k / 2 and rate 1 / 2 the source law is the chi law with k degrees of freedom, whose density is 2 ^ (1 - k / 2) / Γ (k / 2) * t ^ (k - 1) * exp (-t ^ 2 / 2), and the target law is TauCeti.Probability.chiSquaredMeasure k. That is the shape in which a triangular factorisation meets a chi-squared law: the diagonal entries of a Cholesky factor carry the chi density directly, and it is their squares that are chi-squared.

Main results #

References #

The square of a root-gamma variable is gamma. On the positive half-line the density 2 * r ^ a / Γ a * t ^ (2 * a - 1) * exp (-(r * t ^ 2)) is carried by squaring to the gamma law of shape a and rate r.

The root-gamma density is normalised: for a positive shape and rate it carries total mass one, which is what makes the constant 2 * r ^ a / Γ a the right one.

The square of a chi variable is chi-squared. On the positive half-line the chi density 2 ^ (1 - k / 2) / Γ (k / 2) * t ^ (k - 1) * exp (-t ^ 2 / 2) is carried by squaring to the chi-squared law with k degrees of freedom.

The square root of a chi-squared variable has the chi density. This inverts TauCeti.Probability.map_sq_withDensity_eq_chiSquaredMeasure.

The chi density is normalised: for positive degrees of freedom it carries total mass one, which is what makes the constant 2 ^ (1 - k / 2) / Γ (k / 2) the right one.