HepLean Documentation

Aesop.Stats.Report

def Aesop.sortedPercentileD {α : Type u_1} (p : Aesop.Percent) (dflt : α) (xs : Array α) :
α

Assumes that xs is ascending. We use a simple nearest-rank definition of percentiles.

Equations
  • Aesop.sortedPercentileD p dflt xs = if (xs.size == 0) = true then dflt else let rank := (xs.size.toFloat * p.toFloat).ceil.toUInt64.toNat.min (xs.size - 1); xs[rank]?.getD dflt
Instances For
    def Aesop.sortedMedianD {α : Type u_1} (dflt : α) (xs : Array α) :
    α
    Equations
    Instances For
      @[reducible, inline]
      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  Instances For