ppad-eproc 0.5.2 → 0.5.3
raw patch · 4 files changed
+48/−1 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Numeric.Eproc.TwoSample: log_evalue_sup_cdf :: State -> [Double]
+ Numeric.Eproc.TwoSample: log_evalue_sup_magnitude :: State -> [Double]
+ Numeric.Eproc.TwoSample: log_evalue_sup_sign :: State -> Double
+ Numeric.Eproc.TwoSample: p_value :: State -> Double
Files
- CHANGELOG +6/−0
- lib/Numeric/Eproc/TwoSample.hs +27/−0
- ppad-eproc.cabal +1/−1
- test/Main.hs +14/−0
CHANGELOG view
@@ -1,5 +1,11 @@ # Changelog +- 0.5.3 (2026-11-15)+ * Adds to Numeric.Eproc.TwoSample the anytime-valid p-value and+ each component's supremum so far (log_evalue_sup_sign,+ log_evalue_sup_magnitude, log_evalue_sup_cdf): which component's+ evidence peaked is the shape of a difference found.+ - 0.5.2 (2026-11-15) * Adds Numeric.Eproc.Merge: the mean of e-values (an e-value under any dependence), their product (under sequential validity), and
lib/Numeric/Eproc/TwoSample.hs view
@@ -81,9 +81,13 @@ -- * Inspection , log_evalue , log_evalue_sup+ , p_value , log_evalue_sign , log_evalue_magnitude , log_evalue_cdf+ , log_evalue_sup_sign+ , log_evalue_sup_magnitude+ , log_evalue_sup_cdf , samples ) where @@ -307,6 +311,11 @@ log_evalue_sup = st_sup {-# INLINE log_evalue_sup #-} +-- | The anytime-valid p-value: @min 1 (exp (- log_evalue_sup))@.+p_value :: State -> Double+p_value st = min 1 (exp (negate (st_sup st)))+{-# INLINE p_value #-}+ -- | The sign component's current log e-value. log_evalue_sign :: State -> Double log_evalue_sign = Sign.log_evalue . st_sign@@ -323,6 +332,24 @@ log_evalue_cdf :: State -> [Double] log_evalue_cdf = fmap Magn.log_evalue . st_cdf {-# INLINE log_evalue_cdf #-}++-- | The supremum so far of the sign component's log e-value: which+-- component's evidence peaked is the shape of a difference found.+log_evalue_sup_sign :: State -> Double+log_evalue_sup_sign = Sign.log_evalue_sup . st_sign+{-# INLINE log_evalue_sup_sign #-}++-- | The supremum so far of each clipped component's log e-value, in+-- the order of the clip bounds.+log_evalue_sup_magnitude :: State -> [Double]+log_evalue_sup_magnitude = fmap Magn.log_evalue_sup . st_magn+{-# INLINE log_evalue_sup_magnitude #-}++-- | The supremum so far of each indicator component's log e-value, in+-- the order of the cut points.+log_evalue_sup_cdf :: State -> [Double]+log_evalue_sup_cdf = fmap Magn.log_evalue_sup . st_cdf+{-# INLINE log_evalue_sup_cdf #-} -- | How many observations the hedge has seen. samples :: State -> Int
ppad-eproc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-eproc-version: 0.5.2+version: 0.5.3 synopsis: Anytime-valid sequential testing via e-processes. license: MIT license-file: LICENSE
test/Main.hs view
@@ -1237,6 +1237,20 @@ assertBool "a margin at a clip bound was accepted" $ either (const True) (const False) (TS.configInterval 1 1.0e-3 [1] 1 [0])+ , QC.testProperty "each component's supremum bounds its e-value" $+ QC.forAll (QC.listOf ((,) <$> QC.choose (0, 9) <*> QC.choose (0, 9)))+ $ \ps ->+ let cfg = ok (TS.config 0.05 [2, 8] 1 [3, 6])+ st = L.foldl' (TS.update_pair cfg) (TS.initial cfg)+ (fmap (\(a, b) -> (fromIntegral (a :: Int),+ fromIntegral (b :: Int))) ps)+ under xs ys = and (zipWith (\x y -> x <= y + 1.0e-12) xs ys)+ in TS.log_evalue_sign st <= TS.log_evalue_sup_sign st + 1.0e-12+ && under (TS.log_evalue_magnitude st)+ (TS.log_evalue_sup_magnitude st)+ && under (TS.log_evalue_cdf st) (TS.log_evalue_sup_cdf st)+ && TS.p_value st+ == min 1 (exp (negate (TS.log_evalue_sup st))) , QC.testProperty "the supremum bounds the e-value" $ QC.forAll (QC.listOf ((,) <$> QC.choose (0, 9) <*> QC.choose (0, 9))) $ \ps ->