Get a monotonic transform from a real interval to the unconstrained real line.
Source:R/transforms.R
get_transform_to_real_line.RdUses scaled_shifted_log() for intervals of the form
\((-\infty, x]\) or \([x, \infty]\) with finite \(x\).
Uses scaled_logit() for intervals of
the form \((x, y)\) with finite \(x, y\). Uses the identity
transform (base::identity()) for the real line
\((\-infty, infty)\).
Examples
my_scaled_logit <- get_transform_to_real_line(-100, 100)
my_scaled_logit(0)
#> [1] 0
my_scaled_logit(50)
#> [1] 1.098612
my_shifted_log <- get_transform_to_real_line(6, Inf)
my_shifted_log(20)
#> [1] 2.639057
my_other_shifted_log <- get_transform_to_real_line(-Inf, 10)
my_other_shifted_log(-70)
#> [1] -4.382027
# returns the identity transform if given no bounds
my_transform <- get_transform_to_real_line(-Inf, Inf)
my_transform(50)
#> [1] 50