smoothing

package
v8.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 2

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 Estimate

func Estimate(fe *FilterEstimate) big.Int

Returns the Q.0 position estimate of the filter

func Extrapolate

func Extrapolate(fe *FilterEstimate, 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 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 = smoothing6.FilterEstimate

Alpha Beta Filter "position" (value) and "velocity" (rate of change of value) estimates Estimates are in Q.128 format

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

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

Jump to

Keyboard shortcuts

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