Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tfb_absolute_value

ComputesY = g(X) = Abs(X), element-wise


Description

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.

Usage

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


tfprobability

Interface to 'TensorFlow Probability'

v0.11.0.0
Apache License (>= 2.0)
Authors
Sigrid Keydana [aut, cre], Daniel Falbel [ctb], Kevin Kuo [ctb] (<https://orcid.org/0000-0001-7803-7901>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.