stats

package
v0.0.0-...-66e2823 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EDM

func EDM(input []float64, delta int) int

EDM performs the approximate E-divisive with means calculation as described in https://courses.cit.cornell.edu/nj89/docs/edm.pdf.

EDM is an algorithm for finding breakout points in a time-series data set. The function accepts the input vector, and a window width that describes the search window during which the median breakout must occur. The window, ∂, is described in the paper.

Note this algorithm uses the interval tree median approach as described in the paper. The medians used will have a resolution of 1/(2^d), where d is max(log2(len(input)), 10). That is the value recommended in the paper.

func EDMInt

func EDMInt(input []int, delta int) int

EDMInt is the integer version of EDM.

func EDMX

func EDMX(input []float64, delta int) int

EDMX runs the EDM-X algorithm on a slice of floats.

func EDMXInt

func EDMXInt(input []int, delta int) int

EDMXInt runs the EDM-X algorithm on a slice of integer datapoints.

Types

type IntervalTree

type IntervalTree struct {
	// contains filtered or unexported fields
}

IntervalTree is a structure used to make a calculation of running medians quick. The structure is described in the Section 8/Appendix of the paper.

func NewIntervalTree

func NewIntervalTree(d int) *IntervalTree

NewIntervalTree creates a new IntervalTree of depth d.

func (*IntervalTree) Insert

func (it *IntervalTree) Insert(v float64)

Insert puts an element in an interval tree.

func (*IntervalTree) Median

func (it *IntervalTree) Median() float64

Median returns the current median.

func (*IntervalTree) NumElements

func (it *IntervalTree) NumElements() int

NumElements returns the number of elements in the tree.

func (*IntervalTree) Remove

func (it *IntervalTree) Remove(v float64)

Remove removes an element from an interview tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳