For variables constrained to be in the open interval \((a,b)\) a scaled and translated log-odds transform can be used. If variable \(X\) is declared to have lower bound \(a\) and upper bound \(b\), then it is transformed to a new variable \(Y\), where \(Y = logit (\frac{X - a}{b - a})\)
Examples
lb_ub(x = 0, lb = 0, ub = 1)
#> [1] -Inf
lb_ub(x = 0.2, lb = 0, ub = 1)
#> [1] -1.386294
lb_ub(x = 0.5, lb = 0, ub = 1)
#> [1] 0
inv_lb_ub(lb_ub(0.9))
#> [1] 0.9
