Documentation

FormalSLT.Statistics.ExponentialFamily

Finite exponential families #

This module adds the finite one-parameter exponential-family companion to the Fisher-information and Cramer-Rao layer.

For a finite sample space with positive base weights h and statistic T, the normalizer is

Z(theta) = sum_x h x * exp(theta * T x)

and the log-partition is A(theta) = log Z(theta). The normalized mass function is p_theta(x) = h x * exp(theta * T x - A(theta)).

The main results are the finite-sum textbook identities:

The Bernoulli witness uses Bool, statistic 1{true}, base weights 1, and theta = 0, giving A'(0) = 1/2, A''(0) = 1/4, and Fisher information 1/4.

Finite exponential-family primitives #

noncomputable def FormalSLT.Statistics.ExponentialFamily.finitePartition {Ω : Type u_1} [Fintype Ω] (h T : Ω) (theta : ) :

The finite partition sum Z(theta).

Equations
Instances For
    noncomputable def FormalSLT.Statistics.ExponentialFamily.finiteLogPartition {Ω : Type u_1} [Fintype Ω] (h T : Ω) (theta : ) :

    The log-partition function A(theta) = log Z(theta).

    Equations
    Instances For
      noncomputable def FormalSLT.Statistics.ExponentialFamily.finiteExponentialPMF {Ω : Type u_1} [Fintype Ω] (h T : Ω) (theta : ) (x : Ω) :

      The natural-parameter finite exponential-family mass function.

      Equations
      Instances For
        noncomputable def FormalSLT.Statistics.ExponentialFamily.finiteExponentialPMFDeriv {Ω : Type u_1} [Fintype Ω] (h T : Ω) (theta : ) (x : Ω) :

        The natural-parameter derivative of the finite exponential-family mass.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem FormalSLT.Statistics.ExponentialFamily.finitePartition_pos {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {h T : Ω} (hpos : ∀ (x : Ω), 0 < h x) (theta : ) :
          0 < finitePartition h T theta

          Positivity of the finite partition sum under positive base weights.

          theorem FormalSLT.Statistics.ExponentialFamily.finiteExponentialPMF_sum_one {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hZ : 0 < finitePartition h T theta) :
          x : Ω, finiteExponentialPMF h T theta x = 1

          The normalized exponential-family masses sum to one.

          theorem FormalSLT.Statistics.ExponentialFamily.finiteExponentialPMF_pos {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hpos : ∀ (x : Ω), 0 < h x) (x : Ω) :
          0 < finiteExponentialPMF h T theta x

          Exponential-family masses are positive under positive base weights.

          theorem FormalSLT.Statistics.ExponentialFamily.finitePartition_hasDerivAt {Ω : Type u_1} [Fintype Ω] (h T : Ω) (theta : ) :
          HasDerivAt (fun (u : ) => finitePartition h T u) (∑ x : Ω, h x * Real.exp (theta * T x) * T x) theta

          Differentiating the finite partition sum termwise.

          theorem FormalSLT.Statistics.ExponentialFamily.finiteExponentialFamily_mean_eq_logPartition_deriv {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hZ : 0 < finitePartition h T theta) :
          ClassicalEstimation.weightedExpectation (finiteExponentialPMF h T theta) T = (∑ x : Ω, h x * Real.exp (theta * T x) * T x) / finitePartition h T theta

          The normalized expectation is the logarithmic derivative numerator divided by Z.

          Log-partition derivative identity.

          For a finite exponential family, the derivative of A(theta) is the finite expectation of the sufficient statistic.

          theorem FormalSLT.Statistics.ExponentialFamily.finiteLogPartition_hasDerivAt_of_positiveBase {Ω : Type u_1} [Fintype Ω] [Nonempty Ω] {h T : Ω} {theta : } (hpos : ∀ (x : Ω), 0 < h x) :

          Textbook positive-base form of the log-partition derivative identity.

          Curvature and variance #

          theorem FormalSLT.Statistics.ExponentialFamily.finiteExponentialPMF_hasDerivAt {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hZ : 0 < finitePartition h T theta) (x : Ω) :
          HasDerivAt (fun (u : ) => finiteExponentialPMF h T u x) (finiteExponentialPMFDeriv h T theta x) theta

          The derivative of the finite exponential-family mass.

          theorem FormalSLT.Statistics.ExponentialFamily.finiteMean_hasDerivAt {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hZ : 0 < finitePartition h T theta) :

          Differentiating the finite mean gives the centered second moment.

          The centered second-moment derivative is the finite variance.

          Log-partition curvature identity.

          For a finite exponential family, differentiating the mean gives the variance of the sufficient statistic. This is the one-dimensional Hessian identity A''(theta) = Var_theta(T).

          Textbook positive-base form of the log-partition curvature identity.

          A named equality form of the curvature identity.

          Fisher information connection #

          theorem FormalSLT.Statistics.ExponentialFamily.finiteExponentialFamily_score_eq_centered {Ω : Type u_1} [Fintype Ω] {h T : Ω} {theta : } (hpos : ∀ (x : Ω), 0 < h x) (x : Ω) :

          The natural-parameter score is T - E_theta[T].

          Fisher information equals exponential-family curvature and variance.

          Direct form of I(theta) = A''(theta) for a positive finite exponential family.

          Bernoulli natural-parameter witness #

          The Bernoulli natural-parameter partition sum is 1 + exp(theta).

          At theta = 0, both Bernoulli natural-family atoms have mass 1/2.