Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ExtrapolatedCumSumOfRatio ¶
func ExtrapolatedCumSumOfRatio(delta abi.ChainEpoch, relativeStart abi.ChainEpoch, estimateNum, estimateDenom FilterEstimate) big.Int
Extrapolate the CumSumRatio given two filters. Output is in Q.128 format
Types ¶
type AlphaBetaFilter ¶
type AlphaBetaFilter struct {
// contains filtered or unexported fields
}
func LoadFilter ¶
func LoadFilter(prevEstimate FilterEstimate, alpha, beta big.Int) *AlphaBetaFilter
func (*AlphaBetaFilter) NextEstimate ¶
func (f *AlphaBetaFilter) NextEstimate(observation big.Int, epochDelta abi.ChainEpoch) FilterEstimate
type FilterEstimate ¶
Alpha Beta Filter "position" (value) and "velocity" (rate of change of value) estimates Estimates are in Q.128 format
func DefaultInitialEstimate ¶
func DefaultInitialEstimate() FilterEstimate
func NewEstimate ¶
func NewEstimate(position, velocity big.Int) FilterEstimate
Create a new filter estimate given two Q.0 format ints.
func TestingConstantEstimate ¶
func TestingConstantEstimate(val big.Int) FilterEstimate
Returns an estimate with position val and velocity 0
func TestingEstimate ¶
func TestingEstimate(x, v big.Int) FilterEstimate
Returns and estimate with postion x and velocity v
func (*FilterEstimate) Estimate ¶
func (fe *FilterEstimate) Estimate() big.Int
Returns the Q.0 position estimate of the filter
func (*FilterEstimate) Extrapolate ¶
func (fe *FilterEstimate) Extrapolate(delta abi.ChainEpoch) big.Int
Extrapolate filter "position" delta epochs in the future. Note this is currently only used in testing. Output is Q.256 format for use in numerator of ratio in test caller
func (*FilterEstimate) MarshalCBOR ¶
func (t *FilterEstimate) MarshalCBOR(w io.Writer) error
func (*FilterEstimate) UnmarshalCBOR ¶
func (t *FilterEstimate) UnmarshalCBOR(r io.Reader) error
Click to show internal directories.
Click to hide internal directories.