I am having difficulty computing multiple integrals of functions with taking array inputs. I would like to use scipy.integrate's nquad function
because I need to be able to integrate from -np.inf to np.inf
(I'm working with probability density functions). The issue is nquad expects a function to be formulated like this:
function(x_1, x_2, ..., x_n)
The functions I need to integrate over take this form:
function(np.array([x_1, x_2, ..., x_n]))
Is there a way to change a function that takes an array to accept multiple arguments? If not, is there an alternative to nquad? I tried using quadpy, but it said my integral was over 31, when the actual value was 1.
Thanks for the help.