Documentation

Determinize.Spec.Expectation

Expectation and variance of returned values #

The output law bigStepMeasure program is unnormalized: its total mass, returnProbability, is the probability that the program returns a real. extendedExpectation is the expectation of a law in the extended reals, which is well-defined (HasExpectation) as soon as one of its positive and negative parts is finite; it covers programs such as 1 / uniform(0, 1) whose expectation is +∞. returnedExpectation and returnedVariance are the paper's 𝔼_ret[e] and Var_ret[e]: the expectation and the variance of the output conditioned on returning.

The positive part ∫ v⁺ dμ of the expectation of a real law.

Equations
Instances For

    The negative part ∫ v⁻ dμ of the expectation of a real law.

    Equations
    Instances For

      The expectation of μ is well-defined in [-∞, ∞] when at least one part is finite.

      Equations
      Instances For

        The expectation ∫ v⁺ dμ - ∫ v⁻ dμ in the extended reals; meaningful under HasExpectation μ.

        Equations
        Instances For

          The probability q_e that the program returns a real: the total mass of its output law.

          Equations
          Instances For

            Output law conditioned on returning a real; used only when the return probability is positive.

            Equations
            Instances For

              The expectation 𝔼_ret[e] of the output conditioned on returning, in the extended reals: the expectation of the output law divided by the return probability. It is meaningful when the return probability is positive and HasExpectation (bigStepMeasure program).

              Equations
              Instances For
                noncomputable def Determinize.Spec.returnedVariance (program : Paper.Expr) :

                The variance Var_ret[e] of the output conditioned on returning: Mathlib's variance (∫ (v - ∫ v)²) of the returned law.

                Equations
                Instances For