normal_distribution#

Defines the Normal Distribution.

class NormalDistribution(mu: Union[float, int], sigma: Union[float, int])#

Bases: object

An object which samples values from a normal distributions.

mu#

Mean (“centre”) of the distributions.

sigma#

Standard deviation (spread or “width”) of the distributions.

Must be non-negative.
Raises:
  • ValueError – If sigma < 0.

  • TypeError – If mu is not float or int.

  • TypeError – If sigma is not float or int.

Inits NormalDistribution with the provided arguments.

Parameters:
  • mu – Mean (“centre”) of the distributions.

  • sigma – Standard deviation (spread or “width”) of the distributions. Must be non-negative.

get_random_values(n: int) list[float]#

Samples an array with the given distribution.

Parameters:

n – The number of values.

Returns:

np.ndarray[float]

get_samples_from_hypercube(n: int) list[float]#

Samples n values from a hypercube.

Parameters:

n – the number of samples.

Returns:

Samples of the distribution, sampled from a hypercube.