elisa.util.bslogu#

Bi-Symmetric log transformation for uniform distribution.

See https://iopscience.iop.org/article/10.1088/0957-0233/24/2/027001.

Contributed by @xiesl97 (xiesl97).

log(x, c=0.43429448190325176)[source]#

transformation x -> y c default to 1/log(10)

pow(y, c=0.43429448190325176)[source]#

inverse transformation y -> x c default to 1/log(10)

class BiSymTransform(domain=Real(), c=0.43429448190325176)[source]#

Bases: Transform

Attributes

sign

Sign of the derivative of the transform if it is bijective.

codomain

inv

Methods

__call__(x)

Call self as a function.

forward_shape(shape)

Infers the shape of the forward computation, given the input shape.

inverse_shape(shape)

Infers the shapes of the inverse computation, given the output shape.

call_with_intermediates

domain

log_abs_det_jacobian

tree_flatten

tree_unflatten

property codomain#
log_abs_det_jacobian(x, y, intermediates=None)[source]#
tree_flatten()[source]#
class BiSymLogUniform(low, high, *, c=0.43429448190325176, validate_args=None)[source]#

Bases: TransformedDistribution

the input should be transfor before input

for example: import numpy as np import bslogu as bs from numpyro.distributions import LogUniform, Uniform

Uniform( low , high ) LogUniform( np.log(low) , np.log(high) ) BiSymLogUniform( bs.log(low) , bs.log(high) )

Attributes

batch_shape

Returns the shape over which the distribution parameters are batched.

event_dim

event_shape

Returns the shape of a single sample from the distribution without batching.

mean

Mean of the distribution.

variance

Variance of the distribution.

has_rsample

is_discrete

support

Methods

__call__(*args, **kwargs)

Call self as a function.

cdf(x)

The cumulative distribution function of this distribution.

entropy()

Returns the entropy of the distribution.

enumerate_support([expand])

Returns an array with shape len(support) x batch_shape containing all values in the support.

expand(batch_shape)

Returns a new ExpandedDistribution instance with batch dimensions expanded to batch_shape.

expand_by(sample_shape)

Expands a distribution by adding sample_shape to the left side of its batch_shape.

get_args()

Get arguments of the distribution.

icdf(q)

The inverse cumulative distribution function of this distribution.

infer_shapes(*args, **kwargs)

Infers batch_shape and event_shape given shapes of args to __init__().

mask(mask)

Masks a distribution by a boolean or boolean-valued array that is broadcastable to the distributions Distribution.batch_shape .

sample(key[, sample_shape])

Returns a sample from the distribution having shape given by sample_shape + batch_shape + event_shape.

sample_with_intermediates(key[, sample_shape])

Same as sample except that any intermediate computations are returned (useful for TransformedDistribution).

shape([sample_shape])

The tensor shape of samples from this distribution.

to_event([reinterpreted_batch_ndims])

Interpret the rightmost reinterpreted_batch_ndims batch dimensions as dependent event dimensions.

validate_args([strict])

Validate the arguments of the distribution.

gather_pytree_aux_fields

gather_pytree_data_fields

log_prob

rsample

set_default_validate_args

support

tree_flatten

tree_unflatten

arg_constraints: dict[str, Any] = {'high': Dependent(), 'low': Dependent()}#
reparametrized_params: list[str] = ['low', 'high']#
pytree_data_fields: tuple = ('low', 'high', '_support')#
property support#
property mean#

Mean of the distribution.

property variance#

Variance of the distribution.

cdf(x)[source]#

The cumulative distribution function of this distribution.

Parameters:

value – samples from this distribution.

Returns:

output of the cumulative distribution function evaluated at value.