SciEx.Random (sci_ex v0.2.0)

Functions to efficiently generate arrays of random numbers from random number distributions.

Summary

Functions

Draw nr_of_draws values from a Beta distribution.

Draw nr_of_draws values from a Cauchy distribution.

Draw nr_of_draws values from a Geometric distribution.

Draw nr_of_draws values from a Hypergeometric distribution.

Draw nr_of_draws values from a LogNormal distribution.

Draw nr_of_draws values from a Normal distribution.

Functions

draw_from_beta(a, b, nr_of_draws)

@spec draw_from_beta(float(), float(), integer()) :: SciEx.Array1.t()

Draw nr_of_draws values from a Beta distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.

draw_from_cauchy(median, scale, nr_of_draws)

@spec draw_from_cauchy(float(), float(), integer()) :: SciEx.Array1.t()

Draw nr_of_draws values from a Cauchy distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.

draw_from_geometric(p, nr_of_draws)

@spec draw_from_geometric(float(), integer()) :: SciEx.Array1.t()

Draw nr_of_draws values from a Geometric distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.

draw_from_hypergeometric(pop_size, success_states, sample_size, nr_of_draws)

@spec draw_from_hypergeometric(float(), float(), float(), integer()) ::
  SciEx.Array1.t()

Draw nr_of_draws values from a Hypergeometric distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.

draw_from_log_normal(mean, variance, nr_of_draws)

@spec draw_from_log_normal(float(), float(), integer()) :: SciEx.Array1.t()

Draw nr_of_draws values from a LogNormal distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.

draw_from_normal(mu, sigma, nr_of_draws)

@spec draw_from_normal(float(), float(), integer()) :: SciEx.Array1.t()

Draw nr_of_draws values from a Normal distribution.

This function uses the seed from the current BEAM process, as described in the documentation for the :rand module. In order to get reproducible output, you need to set a new seed. To set a new seed, call the :rand.seed/2 function.