pymc.math.erf#
- pymc.math.erf = Elemwise(scalar_op=erf,inplace_pattern=<frozendict {}>)[source]#
error function
Computes the element-wise error function of a tensor.
- Parameters:
- a
TensorLike
Input tensor
- a
- Returns:
TensorVariable
Output tensor with the error function evaluated at each element, with values in the range [-1, 1]
Notes
This function corresponds to SciPy’s scipy.special.erf function. The error function is defined as: erf(x) = (2/√π) * ∫(0 to x) exp(-t²) dt
Examples
>>> import pytensor >>> import pytensor.tensor as pt >>> x = pt.vector("x") >>> f = pytensor.function([x], pt.erf(x)) >>> f([-1, 0, 1]) array([-0.84270079, 0. , 0.84270079])