psqr

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 3 Imported by: 0

README

psqr

GoDoc

Go implementation of The P-Square Algorithm for Dynamic Calculation of Quantiles and Histograms Without Storing Observations.

The algorithm is proposed for dynamic calculation of [..] quantiles. The estimates are produced dynamically as the observations are generated. The observations are not stored, therefore, the algorithm has a very small and fixed storage requirement regardless of the number of observations.

Documentation

Overview

Package psqr implements P-Square algorithm for estimating quantiles without storing observations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quantile

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

Quantile represents an estimated p-quantile of a stream of observations.

func NewQuantile

func NewQuantile(p float64) *Quantile

NewQuantile returns new p-quantile.

func (*Quantile) Append

func (q *Quantile) Append(v float64)

Append appends v to the stream of observations.

func (*Quantile) GobDecode

func (q *Quantile) GobDecode(data []byte) error

func (*Quantile) GobEncode

func (q *Quantile) GobEncode() ([]byte, error)

func (*Quantile) Reset

func (q *Quantile) Reset()

Reset resets the quantile.

func (*Quantile) Value

func (q *Quantile) Value() float64

Value returns the current estimate of p-quantile.

Jump to

Keyboard shortcuts

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