Help us shape the future of Go! Take the 2026 Go Developer Survey

pewma

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config represents coefficients for calculating specified time series.

func NewConfig

func NewConfig(t int, alpha0 float64, beta float64) (Config, error)

NewConfig returns Config object from supplied values with validation.

type PEWMA

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

PEWMA is Probabilistic EWMA (Exponentially Weighted Moving Average) algorithm.

func New

func New(config Config) *PEWMA

New returns PEWMA object.

func (*PEWMA) Add

func (p *PEWMA) Add(v Value) *PEWMA

Add provides capture supplied value and new PEWMA object.

func (*PEWMA) Analyze

func (p *PEWMA) Analyze(v Value, threshold float64) Status

Analyze caluclates Status from supplied value and threshold.

type Status

type Status int

Status represents analyzing status from supplied value.

const (
	// InTraining represents captured data count has not reached training period.
	InTraining Status = iota
	// InOrdinary represents supplied data is in range of standard deviation.
	InOrdinary
	// Outlier represents supplied data is out of standard deviation.
	Outlier
)

type Value

type Value float64

Value represents acceptable and calculatable.

Jump to

Keyboard shortcuts

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