edo.distributions package

Submodules

edo.distributions.base module

The base class from which all distributions inherit.

class edo.distributions.base.Distribution[source]

Bases: object

An abstract base class for all currently implemented distributions and those defined by users.

abstract sample(nrows=None, random_state=None)[source]

A placeholder function for sampling from the distribution.

edo.distributions.continuous module

All currently implemented continuous distributions.

class edo.distributions.continuous.Gamma(random_state)[source]

Bases: edo.distributions.base.Distribution

The gamma distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Gamma".

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [0, 10] for both alpha and theta.

alphafloat

The shape parameter sampled from param_limits["alpha"]. Instance attribute.

thetafloat

The scale parameter sampled from param_limits["theta"]. Instance attribute.

dtype

alias of float

hard_limits = {'alpha': [0, 10], 'theta': [0, 10]}
name = 'Gamma'
param_limits = {'alpha': [0, 10], 'theta': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the gamma distribution using the provided np.random.RandomState instance.

class edo.distributions.continuous.Normal(random_state)[source]

Bases: edo.distributions.base.Distribution

The normal distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Normal".

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [-10, 10] for mean and [0, 10] for std.

meanfloat”

The mean, sampled from param_limits["mean"]. Instance attribute.

stdfloat

The standard deviation, sampled from param_limits["std"]. Instance attribute.

dtype

alias of float

hard_limits = {'mean': [-10, 10], 'std': [0, 10]}
name = 'Normal'
param_limits = {'mean': [-10, 10], 'std': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the normal distribution using the provided np.random.RandomState instance.

class edo.distributions.continuous.Uniform(random_state)[source]

Bases: edo.distributions.base.Distribution

The uniform distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, Uniform.

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [-10, 10] for bounds.

boundslist of float

The lower and upper bounds of the distribution. Instance attribute.

dtype

alias of float

hard_limits = {'bounds': [-10, 10]}
name = 'Uniform'
param_limits = {'bounds': [-10, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the uniform distribution using the provided np.random.RandomState instance.

edo.distributions.discrete module

All currently implemented discrete distribution classes.

class edo.distributions.discrete.Bernoulli(random_state)[source]

Bases: edo.distributions.base.Distribution

The Bernoulli distribution class, i.e. a binomial distribution with exactly one trial.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Bernoulli".

dtypeint

int([x]) -> integer

param_limitsdict

A dictionary of the limits on the distribution parameter. Defaults to [0, 1] for prob.

probfloat

The success probability, sampled from param_limits["prob"]. Instance attribute.

dtype

alias of int

hard_limits = {'prob': [0, 1]}
name = 'Bernoulli'
param_limits = {'prob': [0, 1]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the Bernoulli distribution using the provided np.random.RandomState instance.

class edo.distributions.discrete.Poisson(random_state)[source]

Bases: edo.distributions.base.Distribution

The Poisson distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of distribution, "Poisson".

dtypeint

int([x]) -> integer

param_limitsdict

A dictionary of the limits of the distribution parameter. Defaults to [0, 10] for lam.

lamfloat

The rate parameter, sampled from param_limits["lam"]. Instance attribute.

dtype

alias of int

hard_limits = {'lam': [0, 10]}
name = 'Poisson'
param_limits = {'lam': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the Poisson distribution using the provided np.random.RandomState instance.

Module contents

Top-level imports for the edo.distributions subpackage.

class edo.distributions.Bernoulli(random_state)[source]

Bases: edo.distributions.base.Distribution

The Bernoulli distribution class, i.e. a binomial distribution with exactly one trial.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Bernoulli".

dtypeint

int([x]) -> integer

param_limitsdict

A dictionary of the limits on the distribution parameter. Defaults to [0, 1] for prob.

probfloat

The success probability, sampled from param_limits["prob"]. Instance attribute.

dtype

alias of int

hard_limits = {'prob': [0, 1]}
name = 'Bernoulli'
param_limits = {'prob': [0, 1]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the Bernoulli distribution using the provided np.random.RandomState instance.

class edo.distributions.Distribution[source]

Bases: object

An abstract base class for all currently implemented distributions and those defined by users.

abstract sample(nrows=None, random_state=None)[source]

A placeholder function for sampling from the distribution.

class edo.distributions.Gamma(random_state)[source]

Bases: edo.distributions.base.Distribution

The gamma distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Gamma".

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [0, 10] for both alpha and theta.

alphafloat

The shape parameter sampled from param_limits["alpha"]. Instance attribute.

thetafloat

The scale parameter sampled from param_limits["theta"]. Instance attribute.

dtype

alias of float

hard_limits = {'alpha': [0, 10], 'theta': [0, 10]}
name = 'Gamma'
param_limits = {'alpha': [0, 10], 'theta': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the gamma distribution using the provided np.random.RandomState instance.

class edo.distributions.Normal(random_state)[source]

Bases: edo.distributions.base.Distribution

The normal distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, "Normal".

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [-10, 10] for mean and [0, 10] for std.

meanfloat”

The mean, sampled from param_limits["mean"]. Instance attribute.

stdfloat

The standard deviation, sampled from param_limits["std"]. Instance attribute.

dtype

alias of float

hard_limits = {'mean': [-10, 10], 'std': [0, 10]}
name = 'Normal'
param_limits = {'mean': [-10, 10], 'std': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the normal distribution using the provided np.random.RandomState instance.

class edo.distributions.Poisson(random_state)[source]

Bases: edo.distributions.base.Distribution

The Poisson distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of distribution, "Poisson".

dtypeint

int([x]) -> integer

param_limitsdict

A dictionary of the limits of the distribution parameter. Defaults to [0, 10] for lam.

lamfloat

The rate parameter, sampled from param_limits["lam"]. Instance attribute.

dtype

alias of int

hard_limits = {'lam': [0, 10]}
name = 'Poisson'
param_limits = {'lam': [0, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the Poisson distribution using the provided np.random.RandomState instance.

class edo.distributions.Uniform(random_state)[source]

Bases: edo.distributions.base.Distribution

The uniform distribution class.

Parameters
random_statenumpy.random.RandomState

The PRNG used to sample instance parameters from param_limits.

Attributes
namestr

Name of the distribution, Uniform.

dtypefloat

Convert a string or number to a floating point number, if possible.

param_limitsdict

A dictionary of limits on the distribution parameters. Defaults to [-10, 10] for bounds.

boundslist of float

The lower and upper bounds of the distribution. Instance attribute.

dtype

alias of float

hard_limits = {'bounds': [-10, 10]}
name = 'Uniform'
param_limits = {'bounds': [-10, 10]}
sample(nrows, random_state)[source]

Take a sample of size nrows from the uniform distribution using the provided np.random.RandomState instance.