timeseries

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeSeries

type TimeSeries[T number] struct {
	// contains filtered or unexported fields
}

func NewTimeSeries

func NewTimeSeries[T number](params TimeSeriesParams) *TimeSeries[T]

func (*TimeSeries[T]) AddSample

func (t *TimeSeries[T]) AddSample(val T)

func (*TimeSeries[T]) AddSampleAt

func (t *TimeSeries[T]) AddSampleAt(val T, at time.Time)

func (*TimeSeries[T]) ClearSamples

func (t *TimeSeries[T]) ClearSamples()

func (*TimeSeries[T]) CommitActiveSample

func (t *TimeSeries[T]) CommitActiveSample()

func (*TimeSeries[T]) CommitActiveSampleAt

func (t *TimeSeries[T]) CommitActiveSampleAt(at time.Time)

func (*TimeSeries[T]) CurrentRun

func (t *TimeSeries[T]) CurrentRun(threshold T, op TimeSeriesCompareOp) time.Duration

func (*TimeSeries[T]) GetSamples

func (t *TimeSeries[T]) GetSamples() []TimeSeriesSample[T]

func (*TimeSeries[T]) GetSamplesAfter added in v1.5.6

func (t *TimeSeries[T]) GetSamplesAfter(at time.Time) []TimeSeriesSample[T]

func (*TimeSeries[T]) KendallsTau

func (t *TimeSeries[T]) KendallsTau(numSamplesToUse int) (float64, error)

func (*TimeSeries[T]) LinearExtrapolateTo added in v1.5.6

func (t *TimeSeries[T]) LinearExtrapolateTo(numSamplesToUse int, after time.Duration) (float64, error)

func (*TimeSeries[T]) Max

func (t *TimeSeries[T]) Max() T

func (*TimeSeries[T]) Min

func (t *TimeSeries[T]) Min() T

func (*TimeSeries[T]) OnlineAverage

func (t *TimeSeries[T]) OnlineAverage() float64

func (*TimeSeries[T]) OnlineStdDev

func (t *TimeSeries[T]) OnlineStdDev() float64

func (*TimeSeries[T]) OnlineVariance

func (t *TimeSeries[T]) OnlineVariance() float64

func (*TimeSeries[T]) Slope added in v1.5.6

func (t *TimeSeries[T]) Slope() float64

func (*TimeSeries[T]) Sum

func (t *TimeSeries[T]) Sum() float64

func (*TimeSeries[T]) UpdateSample

func (t *TimeSeries[T]) UpdateSample(val T)

func (*TimeSeries[T]) ZScore

func (t *TimeSeries[T]) ZScore(val T) float64

type TimeSeriesCompareOp

type TimeSeriesCompareOp int
const (
	TimeSeriesCompareOpEQ TimeSeriesCompareOp = iota
	TimeSeriesCompareOpNE
	TimeSeriesCompareOpGT
	TimeSeriesCompareOpGTE
	TimeSeriesCompareOpLT
	TimeSeriesCompareOpLTE
)

func (TimeSeriesCompareOp) String

func (t TimeSeriesCompareOp) String() string

type TimeSeriesParams

type TimeSeriesParams struct {
	UpdateOp         TimeSeriesUpdateOp
	Window           time.Duration
	CollapseDuration time.Duration
}

type TimeSeriesSample

type TimeSeriesSample[T number] struct {
	Value T
	At    time.Time
}

type TimeSeriesUpdateOp

type TimeSeriesUpdateOp int
const (
	TimeSeriesUpdateOpAdd TimeSeriesUpdateOp = iota
	TimeSeriesUpdateOpMax
	TimeSeriesUpdateOpLatest
)

func (TimeSeriesUpdateOp) String

func (t TimeSeriesUpdateOp) String() string

Jump to

Keyboard shortcuts

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