No inverse trig in pm.math functions?

Hello all,

Am doing some modelling for a project and spotted there isn’t an inverse version of sin,cos…etc in the latest documentation. It isn’t too much trouble for me since I can just do it differently and transform my variables back after the inference but I just wanted to check that I’m not being silly and missing something like an argument in pm.math.cos() or if it is just something to be added at a later date?

The computational backend for PyMC is pytensor. pm.math aliases some commonly used functions, but you can find almost all numpy-equivalent functions in pytensor.tensor. For example:

import pytensor.tensor as pt
x = pt.arccos(1)
x.eval()
>>> Out: array(0., dtype=float32)
1 Like

Ahh that makes sense. Much appreciated!

It might be nice to open an issue on the PyMC github repo to note that several np. functions are missing from pm.math, including the inverse trig functions (also others like round, floor, ceil, min, max). It would be a good first PR too. If you do it, tag me and I can help you through the process.

1 Like