Setup:
- Python 3.5.3 |Continuum Analytics, Inc.| (default, Mar 6 2017, 12:15:08)
- Mac OSX 10.13.1
Problem:
I have downloaded the following R script https://github.com/daleroberts/heston/blob/master/heston.r and I repeatedly call one of the functions in there via Python using the package RPy2. Now, for some of my inputs that I feed into the R function, R returns the following error:
rpy2.rinterface.RRuntimeError: Error in integrate(PIntegrand, lower = 0, upper = Inf, lambda, vbar, eta, : roundoff error was detected
How do I go about catching this RuntimeError in Python?