296 views

Uploaded by rndomperson

Numerical optimisation methods using Excel VBA.

- MTools v1.09 for Excel 2007-2013
- project 3 - grade book
- Siebel Testing
- Splitup of Sem1
- Newton-Raphson Method in Excel VBA
- Design a VBA User Form - Option Buttons, Command Buttons, Picture Boxes
- 2010 11Annual Report
- Heyebook
- VBA_Training_Document.pdf
- Release Notes Safe 2014 v 1420
- Fundamentals of Electricity Derivatives
- During the Previous Spring Semester To
- Create PowerPoint Presentations Automatically Using VBA _ Chandoo.org - Learn Microsoft Excel Online
- GL Budgeting Process
- Big Er Hull 1983
- Microsoft Excel Presentation 17558
- Locals to Chas Tic Jump Diffusion
- Trainer Credentials - S M Sumsul Islam
- EXLerate Reference Manual I
- abc

You are on page 1of 4

Newtons Algorithm

Newton's algorithm, alternately called the Newton-Raphson method, is a numerical method for solving equations of the type f(x)=0. It has numerous applications in finance, and we will use it to determine the volatility surface for a call option using the Black Scholes VBA function. The method applies when we have a close approximation for a solution to the equation. The method assumes that the tangent to the graph at our approximation intersects the x-axis closer to the solution of the equation, i.e. closer to where the line we are evaluating intersects the x-axis. By solving for where the tangent intersects the xaxis, and repeating the process from that point, we get closer and closer to the actual solution of the equation. Let's say we're at our approximate solution, x0. The value of y-axis at this point is y = f(x0). We know that the tangent has gradient f'(x) - the same gradient as the line, from the definition of a tangent. We also know that a univariate linear function takes the form f(x) = mx + c, where m is the gradient, x is the horizontal displacement from the starting point, and c is the vertical displacement from the starting point. As such, we have y = f'(x0)(x-x0) + f(x0) as the line of the tangent. We solve this for y = 0 in order to get the next guesstimate of the solution to f(x) = 0. The above is the simpler method of interpretation, but the statement f(x) = mx+c is actually derived from the more generalised Taylor's series expansion where a continuous, differentiable function f may be expanded about a point c as follows: f(x) =f(c)+f'(c)(x-c)+f''(c)/2!*(xc)^2+... This is the univariate version of the Taylor expansion, but it will suffice for finding, for example, volatility smiles since we assume that all other variables remain constant. Since the equation is linear, no second order derivatives exist so these fall away, leaving f(x) =f(c)+f'(c)(x-c). In our example, x0=c, giving y = f'(x0)(x-x0) + f(x0) The equation of the intersection of the tangent with the y-axis is given by the following: 0 = f'(x0)(x1-x0) + f(x0) We then solve for x1 x1 = x0 - (f(x0)/f'(x0) From this we can induce (though actual proof is out of scope here), that xn+1 = xn - f(xn)/f'(xn) , which is the formula for Newton's method. The formula for Newton's method works in cases where the function is differentiable, and where the gradient is not equal to zero.

VBA implementation of Newton's algorithm

Here is an implementation of Newton's algorithm for a simple function, f(x) = x2 - 3. For the volatility surface version, func(x_n) will be replaced by the Black Scholes VBA pricing function, and func_dash(x_n) will be replaced by the VBA function for calculating vega, the first derivative of the option price with respect to volatility. Function Newton(Seed As Double, Precision As Double) As Double Dim x_next As Double, x_n As Double, error_val As Double Dim ctr As Integer x_n = Seed ctr = 0 Do x_next = x_n - func(x_n) / func_dash(x_n) error_val = x_next - x_n x_n = x_next ctr = ctr + 1 Loop Until (Abs(error_val) <= Precision Or ctr = 1000) Newton = x_next End Function Function func(x_n) As Double func = x_n ^ 2 - 3 End Function Function func_dash(x_n) As Double func_dash = 2 * x_n End Function

You can get complete Excel apps from VBA Develeoper.net containing the code in this document, customisation, VBA development of any Excel, Access and Outlook apps, as well as C# and C++ add-ins and technical documentation.

How to build a Black Scholes VBA Option Pricer

How to build a Black Scholes C# Option Pricer How to build a Black Scholes VBA Option Pricer for FX Options How to build a Black Scholes VBA Option Pricer for Equity Options How to build a Black Scholes VBA Option Pricer using Monte Carlo Simulation How to build a Black Scholes VBA Option Pricer for Binary Options How to build a Black Scholes VBA Option Pricer for Equity Barrier Options How to build a Black Scholes VBA Option Pricer for Exotic Asian Options How to build a Black Scholes VBA Option Pricer for Exotic Lookback Options How to build an Equity Option Pricer using the Binomial Tree in Excel VBA How to code a Choleskey Decomposition in VBA (Numerical Methods for Excel) 3 ways to sort in VBA How to Code a Multivariate Value at Risk (VaR) VBA Monte Carlo Simulation How To Code the Newton-Raphson Method in Excel VBA How to Model Volatility Smiles, Volatility Term Structure and the Volatility Surface in Excel VBA How To Write Use Cases for a Portfolio Reporting VBA Tool How To Write a User Interface Model For a Portfolio Reporting VBA Tool How To Create a Semantic Object Model For a Portfolio Reporting VBA Tool How To Normalise a Database For VBA Apps How To Create a Database using SQL Scripts for a Portfolio Reporting VBA App How to Write Stored Procedures in SQL/Access/VBA for a Portfolio Reporting VBA App How to Use Cursors in SQL for a Portfolio Reporting VBA Tool How to Move Data from Access to Excel with SQL for a Portfolio Reporting VBA App

Portfolio Reporting VBA Tool: Inserting Data into SQL/Access Databases from Excel Portfolio Reporting VBA Tool: Connecting Excel with SQL & Access Databases How To Design Classes For an Option Pricer in VBA: UML Concepts How To Design Classes for Object Orientated VBA Programming

- MTools v1.09 for Excel 2007-2013Uploaded bygverma
- project 3 - grade bookUploaded byapi-244997961
- Siebel TestingUploaded bySreeharshavardhanreddy Minammareddy
- Splitup of Sem1Uploaded byJyotiKalsaria
- Newton-Raphson Method in Excel VBAUploaded byMagno Felipe Teixeira
- Design a VBA User Form - Option Buttons, Command Buttons, Picture BoxesUploaded byReaper's Scythe
- 2010 11Annual ReportUploaded bysamgmg
- HeyebookUploaded bygerte_yuew
- VBA_Training_Document.pdfUploaded byJack Desouza
- Release Notes Safe 2014 v 1420Uploaded byNick Bester
- Fundamentals of Electricity DerivativesUploaded byFrancisco José Murias Dominguez
- During the Previous Spring Semester ToUploaded bygerte_yuew
- Create PowerPoint Presentations Automatically Using VBA _ Chandoo.org - Learn Microsoft Excel OnlineUploaded byGénesis Del Carmen
- GL Budgeting ProcessUploaded byspondugula
- Big Er Hull 1983Uploaded byUzair Umair
- Microsoft Excel Presentation 17558Uploaded byamitarya514
- Locals to Chas Tic Jump DiffusionUploaded bygarycwk
- Trainer Credentials - S M Sumsul IslamUploaded byLony
- EXLerate Reference Manual IUploaded byMisbah El Munir
- abcUploaded bytbijle
- Bond Valuation and Pricing of Interest Rate Options in IndiaUploaded bySumit Bhartia
- Perkiraan ArusUploaded bymof98009
- Teaching Excel 1627Uploaded byFazal Khan
- microsoft excelUploaded byspirit571
- l7 - work scenarioUploaded byapi-463766155
- American Options v2Uploaded byfatcode27
- dictaat.pdfUploaded byGisselaPozo
- Excel Spreadsheet to PDFUploaded byKristin
- index of SAP FM'sUploaded byAnonymous zWS4U8N
- BlastQuarter_03Uploaded byAndy Rivera

- Bill GatesUploaded byBawang Hangit
- Customer Merge DQM.pdfUploaded byshameem_fics
- Online SmartTest Setup v1.0Uploaded byAshwin Reddy
- Geovia Gems BrochureUploaded byKenny Casilla
- Background ProcessingUploaded bySaket Shahi
- Btech S8 CSE syllabus MG universityUploaded bySanJO
- Hi Path 3000 Service ManualUploaded bysan
- The Future Was Here - The Commodore AmigaUploaded bymimanolis
- 775i65GUploaded bycancha
- D60488GC20_sg3Uploaded byjuancmontenegrol
- Hp serie 500Uploaded byfreddi2009
- Java OOPs ConceptsUploaded byAjai Kumar
- Insurance Mobile Solutions | HexawareUploaded byHexaware Technologies
- 1317_Leng_CUploaded byÁlvarez Javier
- Start,Run Commands Xp,7Uploaded byЮрий Изобретатель
- ECE-01Uploaded byGanesh Kaveti
- Mod 3_LNUploaded byManoj Kumar Maurya
- Literal,Keywords,Variable,FunctionsUploaded byAdir khan
- Building the Marketing Plan Blueprint HubspotUploaded byAlfredo Chavez
- Atoll 2.8.0 General Features Radio Public CourseUploaded byAmine Gigi
- Vostro_14_15_3000_3468_3478_3568_3562_3572_3578_Customer_Brochure_VEGAS_VEGAS_MLKUploaded bykrisshawk
- 1st Order System in XCOS-ScilabUploaded bysalaideva thirumani
- The_Pirate_Book.pdfUploaded byNancy Soriano
- Driver Installation TrickUploaded bygoodboyrd20
- 786GUIDELINES FOR PREPARATION OF PROJECT REPORT.docUploaded byRubina Ajrii
- Huawei Y5 ManualUploaded byJusst X Mequerty
- Fiery®Network Controller for WorkCentre 7700 Series MFPUploaded byRumen Stoychev
- PDS NOVEMBER DECEMBER 2014 solved.docxUploaded byAnonymous ZvETnSajS
- ePSA_UGUploaded byJoseManuelContrerasPerez
- zen11_utilsUploaded byFederico Bardanca Sotelo