smoothing

package
v2.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2021 License: Apache-2.0, MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAlpha                   big.Int // Q.128 value of 9.25e-4
	DefaultBeta                    big.Int // Q.128 value of 2.84e-7
	ExtrapolatedCumSumRatioEpsilon big.Int // Q.128 value of 2^-50
)

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

type FilterEstimate struct {
	PositionEstimate big.Int // Q.128
	VelocityEstimate big.Int // Q.128
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL