bayes

package
v0.0.0-...-55c0a6c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Odds

func Odds(p float64) float64

func Propability

func Propability(o float64) float64

Computes the Propability given its odds Example: o=2 means 2:1 odds in favor, or 2/3 propability

func Propability2

func Propability2(yes float64, no float64) float64

Types

type Hist

type Hist struct {
	Items map[interface{}]*big.Float
	// contains filtered or unexported fields
}

func NewHistogram

func NewHistogram(values interface{}) (h *Hist, ok bool)

func (*Hist) Exponate

func (h *Hist) Exponate()

func (*Hist) Fraction

func (h *Hist) Fraction(factor float64)

Divides all items of the Histogram in this manner factor / item

func (*Hist) Freq

func (h *Hist) Freq(value interface{}) (freq float64, ok bool)

func (*Hist) Freqs

func (h *Hist) Freqs() []float64

func (*Hist) Get

func (h *Hist) Get(item interface{}) (i interface{}, res float64)

func (*Hist) GetBig

func (h *Hist) GetBig(item interface{}) (interface{}, *big.Float)

func (*Hist) Incr

func (h *Hist) Incr(factor float64)

func (*Hist) MaxFreq

func (h *Hist) MaxFreq() (item interface{}, res float64)

func (*Hist) Remove

func (h *Hist) Remove(item interface{})

func (*Hist) Scale

func (h *Hist) Scale(factor float64)

func (*Hist) ScaleBig

func (h *Hist) ScaleBig(factor *big.Float)

func (*Hist) Substract

func (h *Hist) Substract(other *Hist)

func (*Hist) Total

func (h *Hist) Total() float64

type Interpolator

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

func NewInterpolator

func NewInterpolator(x []float64, y []float64) *Interpolator

func (*Interpolator) Lookup

func (i *Interpolator) Lookup(x float64)

type OrderedHist

type OrderedHist struct {
	Hist
	// contains filtered or unexported fields
}

func NewOrderedHistFromFloat

func NewOrderedHistFromFloat(values []float32) (o *OrderedHist, ok bool)

func (*OrderedHist) Get

func (oh *OrderedHist) Get(v float32) (key float32, value interface{})

func (*OrderedHist) Keys

func (oh *OrderedHist) Keys() []float32

type Pmf

type Pmf struct {
	SortedHist
}

func NewPmf

func NewPmf(values interface{}) (p *Pmf, ok bool)

func (*Pmf) Fraction

func (p *Pmf) Fraction(a, b int64)

func (*Pmf) Normalize

func (p *Pmf) Normalize(fraction float64) error

func (*Pmf) Prob

func (p *Pmf) Prob(x interface{}, def float64) float64

type SortedHist

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

func CreateSortedHist

func CreateSortedHist(h *Hist) (sh *SortedHist)

func NewSortedHist

func NewSortedHist(values interface{}) (sh *SortedHist, ok bool)

func (*SortedHist) Frac

func (s *SortedHist) Frac(factor float64)

func (*SortedHist) Freqs

func (s *SortedHist) Freqs() []float64

func (*SortedHist) Keys

func (s *SortedHist) Keys() (r []interface{})

func (*SortedHist) Len

func (s *SortedHist) Len() int

func (*SortedHist) Less

func (s *SortedHist) Less(i, j int) bool

func (*SortedHist) Scale

func (s *SortedHist) Scale(factor float64)

func (*SortedHist) Swap

func (s *SortedHist) Swap(i, j int)

Jump to

Keyboard shortcuts

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