This non-injective bijector allows for transformations of scalar distributions with the absolute value function, which maps (-inf, inf) to [0, inf).

  • For y in (0, inf), tfb_absolute_value$inverse(y) returns the set inverse {x in (-inf, inf) : |x| = y} as a tuple, -y, y. tfb_absolute_value$inverse(0) returns 0, 0, which is not the set inverse (the set inverse is the singleton {0}), but "works" in conjunction with TransformedDistribution to produce a left semi-continuous pdf. For y < 0, tfb_absolute_value$inverse(y) happily returns the wrong thing, -y, y This is done for efficiency. If validate_args == TRUE, y < 0 will raise an exception.

tfb_absolute_value(validate_args = FALSE, name = "absolute_value")

Arguments

validate_args

Logical, default FALSE. Whether to validate input with asserts. If validate_args is FALSE, and the inputs are invalid, correct behavior is not guaranteed.

name

name prefixed to Ops created by this class.

Value

a bijector instance.

See also