util

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package util is a set of utility functions that are used throughout the matrixprofile package.

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 BinarySplit added in v0.3.4

func BinarySplit(lb, ub int) []int

func E2P added in v0.4.1

func E2P(mp []float64, w int)

E2P converts a slice of euclidean distances to pearson correlation values. This is only valid for z-normalized time series. Negative pearson correlation values will not be discovered

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 P2E added in v0.4.0

func P2E(mp []float64, w int)

P2E converts a slice of pearson correlation values to euclidean distances. This is only valid for z-normalized time series.

func Sum2s

func Sum2s(a []float64, w int) []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