math

package
v0.0.0-...-4408542 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2014 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BernRand

func BernRand(μ float64) func() float64

BernRand returns Bernoulli distributed random variables: x ~ Bern(x|μ)

func DiracRand

func DiracRand(c float64) func() float64

DiracRand returns a constant value c

func Max

func Max(array []float64) (float64, []int)

Max returns maximal value and its indices of a slice

func NormRand

func NormRand(μ, σ float64) func() float64

NormRand returns normally distributed random variables: x ~ N(x|μ,σ)

Types

type BetaRand

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

A BetaRand is a source of random numbers.

func NewBetaRand

func NewBetaRand(seed int64) *BetaRand

NewBetaRand returns a new BetaRand that uses random values from rand to generate beta random values.

func (*BetaRand) NextBeta

func (r *BetaRand) NextBeta(α, β float64) float64

NextBeta returns beta distributed random variables: x ~ Beta(α, β) implementation follows R.C.H. Cheng: Generating Beta Variates with Nonintegral Shape Parameters

Jump to

Keyboard shortcuts

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