Copyright | © 2022 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module provides a maximum likelhood estimator for pool performance.
Copy & paste of the original implementation in
cardano-ledgererasshelleyimplsrcCardanoLedgerShelleyPoolRank.hs
The copy was made in order to reduce (transitive) dependencies.
Synopsis
-
data
BlockProduction
=
BlockProduction
{
- blocksProduced :: ! Natural
- stakeRelative :: ! Rational
- newtype PerformanceEstimate = PerformanceEstimate { }
- estimatePoolPerformance :: SlottingParameters -> DecentralizationLevel -> Seq BlockProduction -> PerformanceEstimate
-
newtype
LogWeight
=
LogWeight
{
- unLogWeight :: Float
- newtype Likelihood = Likelihood { }
- likelihood :: Natural -> Double -> EpochSize -> Likelihood
- applyDecay :: Float -> Likelihood -> Likelihood
- newtype Histogram = Histogram { }
- percentile' :: Likelihood -> PerformanceEstimate
Pool performance estimate from historical block production
data BlockProduction Source #
Information about block production of a pool in one epoch.
BlockProduction | |
|
newtype PerformanceEstimate Source #
This is a estimate of the proportion of allowed blocks a pool will make in the future. It is used for ranking pools in delegation.
Instances
Eq PerformanceEstimate Source # | |
Defined in Cardano.Pool.Rank.Likelihood (==) :: PerformanceEstimate -> PerformanceEstimate -> Bool Source # (/=) :: PerformanceEstimate -> PerformanceEstimate -> Bool Source # |
|
Show PerformanceEstimate Source # | |
Defined in Cardano.Pool.Rank.Likelihood |
|
Generic PerformanceEstimate Source # | |
Defined in Cardano.Pool.Rank.Likelihood from :: PerformanceEstimate -> Rep PerformanceEstimate x Source # to :: Rep PerformanceEstimate x -> PerformanceEstimate Source # |
|
NoThunks PerformanceEstimate Source # | |
Defined in Cardano.Pool.Rank.Likelihood |
|
type Rep PerformanceEstimate Source # | |
Defined in Cardano.Pool.Rank.Likelihood
type
Rep
PerformanceEstimate
=
D1
('
MetaData
"PerformanceEstimate" "Cardano.Pool.Rank.Likelihood" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"PerformanceEstimate" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unPerformanceEstimate") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Double
)))
|
estimatePoolPerformance Source #
:: SlottingParameters | |
-> DecentralizationLevel | |
-> Seq BlockProduction |
Historical block production data. Most recent data comes first . Recent performance weighs more than past performance:
|
-> PerformanceEstimate |
Estimate the performance of a pool from historical block production data.
Assumes that the
SlottingParameters
are constant through the given
history.
Likelihood computations
Instances
Eq LogWeight Source # | |
Num LogWeight Source # | |
Defined in Cardano.Pool.Rank.Likelihood (+) :: LogWeight -> LogWeight -> LogWeight Source # (-) :: LogWeight -> LogWeight -> LogWeight Source # (*) :: LogWeight -> LogWeight -> LogWeight Source # negate :: LogWeight -> LogWeight Source # abs :: LogWeight -> LogWeight Source # signum :: LogWeight -> LogWeight Source # fromInteger :: Integer -> LogWeight Source # |
|
Ord LogWeight Source # | |
Defined in Cardano.Pool.Rank.Likelihood |
|
Show LogWeight Source # | |
Generic LogWeight Source # | |
NFData LogWeight Source # | |
Defined in Cardano.Pool.Rank.Likelihood |
|
NoThunks LogWeight Source # | |
type Rep LogWeight Source # | |
Defined in Cardano.Pool.Rank.Likelihood
type
Rep
LogWeight
=
D1
('
MetaData
"LogWeight" "Cardano.Pool.Rank.Likelihood" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"LogWeight" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unLogWeight") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Float
)))
|
newtype Likelihood Source #
Instances
likelihood :: Natural -> Double -> EpochSize -> Likelihood Source #
applyDecay :: Float -> Likelihood -> Likelihood Source #
Decay previous likelihood
Instances
Eq Histogram Source # | |
Show Histogram Source # | |
Generic Histogram Source # | |
type Rep Histogram Source # | |
Defined in Cardano.Pool.Rank.Likelihood
type
Rep
Histogram
=
D1
('
MetaData
"Histogram" "Cardano.Pool.Rank.Likelihood" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"Histogram" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unHistogram") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
StrictSeq
LogWeight
))))
|