Skip to contents

Uses 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)\).

Usage

get_transform_to_real_line(lb, ub)

Arguments

lb

Lower bound of the interval. -Inf for no lower bound.

ub

Upper bound of the interval. Inf for no upper bound.

Value

The transform, as a callable object.

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