BinomialFunction class

(Shortest import: from brian2 import BinomialFunction)

class brian2.input.binomial.BinomialFunction(n, p, approximate=True, name='_binomial*')[source]

Bases: brian2.core.functions.Function, brian2.core.names.Nameable

A function that generates samples from a binomial distribution.

Parameters:

n : int

Number of samples

p : float

Probablility

approximate : bool, optional

Whether to approximate the binomial with a normal distribution if \(n p > 5 \wedge n (1 - p) > 5\). Defaults to True.