tracts.util#

General-purpose helpers used across the package: a stderr-printing convenience function, a same-sign check, and the transformations between physical (time/rate/sex-bias) parameter space and the unconstrained space used internally by the optimizer.

Functions

all_same_sign(lst)

Check whether all elements in a list have the same sign.

eprint(*args, **kwargs)

Print to the standard error stream.

rate_to_optimizer_function(x)

Convert a rate parameter from physical space to optimizer space.

rate_to_physical_function(x)

Convert a rate parameter from optimizer space to physical space.

sex_bias_to_optimizer_function(y)

Convert a sex-bias parameter from physical space to optimizer space.

sex_bias_to_physical_function(x)

Convert a sex-bias parameter from optimizer space to physical space.

time_to_optimizer_function(x)

Convert a time parameter from physical space to optimizer space.

time_to_physical_function(x)

Convert a time parameter from optimizer space to physical space.