laplace#

Module for sampling from a Laplace distribution.

Functions#

laplace_inverse_cdf()

Returns inverse CDF for Lap(u,b) at p.

laplace()

Samples a float from the Laplace distribution.

laplace_inverse_cdf(u, b, p, prec)#

Returns inverse CDF for Lap(u,b) at p.

Parameters
  • u (float) – The mean of the distribution. Must be finite and non-nan.

  • b (float) – The scale of the distribution. Must be finite, non-nan and non-negative.

  • p (tmlt.core.utils.arb.Arb) – Probability to compute the CDF at.

  • prec (int) – Precision to use for computing CDF.

Return type

tmlt.core.utils.arb.Arb

laplace(u, b, step_size=63)#

Samples a float from the Laplace distribution.

Parameters
  • u (float) – The mean of the distribution. Must be finite and non-nan.

  • b (float) – The scale of the distribution. Must be positive, finite and non-nan.

  • step_size (int) – How many bits of probability to sample at a time.

Return type

float