Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Kahan ¶
Kahan implements the Kahan Summation Algorithm: https://en.wikipedia.org/wiki/Kahan_summation_algorithm
Types ¶
type BinomialGenerator ¶
BinomialGenerator is a random number generator built on top of math/rand. It generates a value ~ binomial(n, p)
func (*BinomialGenerator) Int ¶
func (g *BinomialGenerator) Int(n int, p float64) int
Int returns X ~ binomial(n, p) as an int
n = number of tries p = probability of acceptance
if n > 1000, the process used to generate the result is concurrent.
func (*BinomialGenerator) Int64 ¶
func (g *BinomialGenerator) Int64(n int64, p float64) int64
Int64 returns X ~ binomial(n, p) as an int64
n = number of tries p = probability of acceptance
if n > 1000, the process used to generate the result is concurrent.
func (*BinomialGenerator) Multinomial ¶
func (g *BinomialGenerator) Multinomial(n int, probs []float64, retSize int) []int
Click to show internal directories.
Click to hide internal directories.