util

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyExclusionZone

func ApplyExclusionZone(profile []float64, idx, zoneSize int)

ApplyExclusionZone performs an in place operation on a given matrix profile setting distances around an index to +Inf

func ArcCurve

func ArcCurve(mpIdx []int) []float64

ArcCurve computes the arc curve (histogram) which is uncorrected for. This loops through the matrix profile index and increments the counter for each index that the destination index passes through start from the index in the matrix profile index.

func BinarySplit added in v0.3.4

func BinarySplit(lb, ub int) []int

func Iac

func Iac(x float64, n int) float64

Iac represents the ideal arc curve with a maximum of n/2 and 0 values at 0 and n-1. The derived equation to ensure the requirements is -(sqrt(2/n)*(x-n/2))^2 + n/2 = y

func MovMeanStd

func MovMeanStd(ts []float64, m int) ([]float64, []float64, error)

MovMeanStd computes the mean and standard deviation of each sliding window of m over a slice of floats. This is done by one pass through the data and keeping track of the cumulative sum and cumulative sum squared. s between these at intervals of m provide a total of O(n) calculations for the standard deviation of each window of size m for the time series ts.

func MuInvN

func MuInvN(a []float64, w int) ([]float64, []float64)

func Sq2s

func Sq2s(a []float64) float64

func Sum2s

func Sum2s(a []float64, w int) []float64

func TwoSquare

func TwoSquare(a []float64) ([]float64, []float64)

func ZNormalize

func ZNormalize(ts []float64) ([]float64, error)

ZNormalize computes a z-normalized version of a slice of floats. This is represented by y[i] = (x[i] - mean(x))/std(x)

Types

type Batch added in v0.3.6

type Batch struct {
	Idx  int
	Size int
}

Batch indicates which index to start at and how many to process from that index.

func DiagBatchingScheme added in v0.3.6

func DiagBatchingScheme(l, p int) []Batch

DiagBatchingScheme computes a more balanced batching scheme based on the diagonal nature of computing matrix profiles. Later batches get more to work on since those operate on less data in the matrix.

Jump to

Keyboard shortcuts

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