def _yj_trans_single_x(x, lam):
if x >= 0:
# Case 1: x >= 0 and lambda is not 0
if not _eqls(lam, ZERO):
return (np.power(x + 1, lam) - 1.0) / lam
# Case 2: x >= 0 and lambda is zero
return log(x + 1)
else:
# Case 2: x < 0 and lambda is not two
if not lam == 2.0:
denom = 2.0 - lam
numer = np.power((-x + 1), (2.0 - lam)) - 1.0
return -numer / denom
# Case 4: x < 0 and lambda is two
return -log(-x + 1)
评论列表
文章目录