Nov 10

## Numerical Integration Code

Posted by abiao at 21:52 | Code » Matlab | Comments(0) | Reads(8796)
A followup post of my previous entry Using Quadrature method for option valuation, where I tested the alternative numerical method for option valuation, QUAD. If you read the original paper, you will notice at the end all option valuation problems are to solve an integral equation, therefore a good & proper numerical integration method becomes especially crucial.

My example in that post used simply Matlab embedded command "quadl", however, when the option becomes exotic, or the option has multiple observation times (for example, a Bermudan option), quadl can't be applied anymore as we have to match the nodes of these different observation times. (quadl does not allow users to specify how many points and how small interval an integral can have, correct me if i am wrong). Here is a good site on numerical integration code I just dug yesterday: Transforming Numerical Methods Education by University of South Florida, which is for undergraduate student at engineering or mathematics and is therefore in plain language, easy to understand. For example, under integration section, it includes trapezoidal rule, simpson's 1/3rd Rule, Romberg Integration, Gauss-Quadrature Rule, etc, for each numerical integration method, it provides well explained documents, matlab and MATHEMATICA codes, and even Youtube video......

Have fun at http://numericalmethods.eng.usf.edu/index.html. A minor defect is its gauss quadrature point is up to 10 only, no worry, should you are unhappy with that, another C/C++ code on Gauss quadrature can be found at http://www.holoborodko.com/pavel/?page_id=679.

 Add a comment Emots Enable HTML Enable UBB Enable Emots Hidden Remember Nickname   Password   Optional Site URI   Email   [Register]