pymc.math.arctanh#

pymc.math.arctanh = Elemwise(scalar_op=arctanh,inplace_pattern=<frozendict {}>)[source]#

hyperbolic arc tangent of a

Computes element-wise inverse hyperbolic tangent of a tensor.

Parameters:
aTensorLike

Input tensor (values should be in the range [-1, 1])

Returns:
TensorVariable

Output tensor with the hyperbolic arc tangent of each element

Notes

This function corresponds to NumPy’s np.arctanh function. The domain of arctanh is [-1, 1]; values outside this range will produce NaN outputs.

Examples

>>> import pytensor
>>> import pytensor.tensor as pt
>>> x = pt.vector("x")
>>> f = pytensor.function([x], pt.arctanh(x))
>>> f([-0.5, 0, 0.5])
array([-0.54930614,  0.        ,  0.54930614])