Math#
This submodule contains various mathematical functions. Most of them are imported directly from aesara.tensor (see there for more details). Doing any kind of math with PyMC random variables, or defining custom likelihoods or priors requires you to use these Aesara expressions rather than NumPy or Python code.
Functions exposed in pymc namespace#
|
Convert a packed triangular matrix into a two dimensional array. |
|
|
|
The inverse of the logit function, 1 / (1 + exp(-x)). |
|
|
|
|
|
Compute the log of the sum of exponentials of input elements. |
Functions exposed in pymc.math#
|
Return a symbolic dot product. |
|
Return a TensorConstant with value x. |
|
Return a copy of the array collapsed into one dimension. |
|
equivalent of numpy.zeros_like Parameters ---------- model : tensor dtype : data-type, optional opt : If True, we will return a constant instead of a graph when possible. Useful for Aesara optimization, not for user building a graph as this have the consequence that model isn't always in the graph. |
|
equivalent of numpy.ones_like Parameters ---------- model : tensor dtype : data-type, optional opt : If True, we will return a constant instead of a graph when possible. Useful for Aesara optimization, not for user building a graph as this have the consequence that model isn't always in the graph. |
|
Stack tensors in sequence on given axis (default is 0). |
|
|
|
Computes the sum along the given axis(es) of a tensor input. |
|
Computes the product along the given axis(es) of a tensor input. |
a < b Generalizes a scalar Op to tensors. |
|
a > b Generalizes a scalar Op to tensors. |
|
a <= b Generalizes a scalar Op to tensors. |
|
a >= b Generalizes a scalar Op to tensors. |
|
a == b Generalizes a scalar Op to tensors. |
|
a != b Generalizes a scalar Op to tensors. |
|
if cond then ift else iff Generalizes a scalar Op to tensors. |
|
Clip x to be between min and max. |
|
if cond then ift else iff Generalizes a scalar Op to tensors. |
|
bitwise a & b Generalizes a scalar Op to tensors. |
|
bitwise a | b Generalizes a scalar Op to tensors. |
|
e^`a` Generalizes a scalar Op to tensors. |
|
base e logarithm of a Generalizes a scalar Op to tensors. |
|
cosine of a Generalizes a scalar Op to tensors. |
|
sine of a Generalizes a scalar Op to tensors. |
|
tangent of a Generalizes a scalar Op to tensors. |
|
hyperbolic cosine of a Generalizes a scalar Op to tensors. |
|
hyperbolic sine of a Generalizes a scalar Op to tensors. |
|
hyperbolic tangent of a Generalizes a scalar Op to tensors. |
|
square of a Generalizes a scalar Op to tensors. |
|
square root of a Generalizes a scalar Op to tensors. |
|
error function Generalizes a scalar Op to tensors. |
|
inverse error function Generalizes a scalar Op to tensors. |
|
|
Return a symbolic dot product. |
elemwise maximum. |
|
elemwise minimum. |
|
sign of a Generalizes a scalar Op to tensors. |
|
ceiling of a Generalizes a scalar Op to tensors. |
|
floor of a Generalizes a scalar Op to tensors. |
|
Matrix determinant. |
|
Computes the inverse of a matrix \(A\). |
|
Return specified diagonals. |
|
|
Shorthand for product between several dots. |
|
Returns the sum of diagonal elements of matrix X. |
Logistic sigmoid function (1 / (1 + exp(x)), also known as expit or inverse logit Generalizes a scalar Op to tensors. |
|
|
Compute the log of the sum of exponentials of input elements. |
|
The inverse of the logit function, 1 / (1 + exp(-x)). |
|