
Hi, is it possible to solve the swap rate for a particular NPV?
So lets say I would like to know where the swap rate would be for NPV of $100k. Of course I could use the par swap and estimate with the DV01, but is there a direct way?
Also I tried to solve via SLSQP minimisation (would anyhow not be the most elegant way I assume..), but I got the following error:
File "<ipythoninput42ff4834398b56>", line 1, in <module> minimize(solve_swap, 0.01, method='SLSQP', options={'disp': False, 'maxiter': 300, 'ftol': 1e08})
File "C:\ProgramData\Anaconda2_64bit\lib\sitepackages\scipy\optimize\_minimize.py", line 458, in minimize
constraints, callback=callback, **options)
File "C:\ProgramData\Anaconda2_64bit\lib\sitepackages\scipy\optimize\slsqp.py", line 370, in _minimize_slsqp
raise ValueError("Objective function must return a scalar")
ValueError: Objective function must return a scalar
Thanks,
Tobias
