bartz.testing.Uniform

class bartz.testing.Uniform[source]

Continuous uniform distribution, standardized: U(-sqrt(3), sqrt(3)).

property kurtosis: float[source]

Fourth moment E[z ** 4] = 9/5.

sample(key, shape)[source]

Sample i.i.d. standardized continuous uniform values.

Return type:

Float[Array, '*shape']

quantize(x, max_bins)[source]

Quantize values into equal-probability bins.

Parameters:
  • x (Float[Array, '*shape']) – Values drawn from the distribution, of any shape.

  • max_bins (int) – The number of levels.

Returns:

  • quantized_x (UInt[Array, ‘*shape’]) – The bin indices, in [0, max_bins).

  • m (int) – The number of levels, always max_bins.

ppf(u)[source]

Quantile function: map probabilities in [0, 1] to U(-sqrt(3), sqrt(3)).

Return type:

Float[Array, '*shape']

from_standard_normal(z)[source]

Map standard-Normal draws to this family, preserving their Gaussian copula.

Elementwise ppf(Phi(z)): each output is marginally a draw from this family (mean 0, variance 1) while the joint dependence of z carries over as a Gaussian copula. Normal overrides this with the identity.

Return type:

Float[Array, '*shape']