Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Python for Finance

You're reading from   Mastering Python for Finance Understand, design, and implement state-of-the-art mathematical and statistical applications used in finance with Python

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784394516
Length 340 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (17) Chapters Close

Mastering Python for Finance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Python for Financial Applications FREE CHAPTER 2. The Importance of Linearity in Finance 3. Nonlinearity in Finance 4. Numerical Procedures 5. Interest Rates and Derivatives 6. Interactive Financial Analytics with Python and VSTOXX 7. Big Data with Python 8. Algorithmic Trading 9. Backtesting 10. Excel with Python Index

Combining root-finding methods


It is perfectly possible to write your own root-finding algorithms using a combination of the previously mentioned root-finding methods. For example, you may use the following implementation in the following order:

  1. Use the faster secant method to converge the problem to a prespecified error tolerance value or a maximum number of iterations.

  2. Once a prespecified tolerance level is reached, switch to using the bisection method to converge to the root by halving the search interval with each iteration until the root is found.

Brent's method or the Wijngaarden-Dekker-Brent method combines the bisection root-finding method, secant method, and inverse quadratic interpolation. The algorithm attempts to use either the secant method or inverse quadratic interpolation whenever possible, and uses the bisection method where necessary.

Brent's method can also be found in the scipy.optimize.brentq function of SciPy.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images