[SciPy-Dev] adding trapezoidal integration equivalent to logsumexp

Matthew Pitkin matthew.pitkin at glasgow.ac.uk
Thu Feb 4 09:22:27 EST 2016


Dear SciPy-dev list,

I often require using trapezoidal integration of probability 
distribution functions (pdfs). For numerical reasons it is generally 
best to compute the logarithm of the pdfs, so integrating them whilst 
staying in log-space is generally required. Provided the steps between 
points are equal the scipy.misc.logsumexp function can be used for this, 
but I was wondering if a function specifically for this purpose (and 
following the usage of scipy.integrate.trapz function) might be more 
generally useful (called e.g. logtrapz)? I have my own code to do this, 
so if the list thinks this could be useful I can add it into scipy and 
create a pull request.

Regards,

Matt

-- 
-----------------------------------------------------------
Matthew Pitkin
School of Physics and Astronomy
Kelvin Building
University of Glasgow
Glasgow, G12 8QQ

Tel. no.  +44 (0)141 330 7168
Mob. no.  +44 (0)774 050 7792
e-mail    matthew.pitkin at glasgow.ac.uk
http://www.astro.gla.ac.uk/~matthew
-----------------------------------------------------------




More information about the SciPy-Dev mailing list