movingmedian

package module
v0.0.0-...-de8c410 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: MIT Imports: 1 Imported by: 0

README

movingmedian

GoDoc Build Status PR Stats Issues Stats

Description

Package movingmedian computes the median of a windowed stream of data.

Installation

This package can be installed with the go get command:

go get github.com/JaderDias/movingmedian

Documentation

Overview

Package movingmedian computes the median of a windowed stream of data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MovingMedian

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

MovingMedian computes the moving median of a windowed stream of numbers.

func NewMovingMedian

func NewMovingMedian(size int) MovingMedian

NewMovingMedian returns a MovingMedian with the given window size.

func (*MovingMedian) Median

func (m *MovingMedian) Median() float64

Median returns the current value of the median from the window.

func (*MovingMedian) Push

func (m *MovingMedian) Push(v float64)

Push adds an element to the stream, removing old data which has expired from the window. It runs in O(log windowSize).

Jump to

Keyboard shortcuts

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