# Estimating Implied Volatility in VBA with the Newton-Raphson method

## Newton-Raphson and implied volatility

The implied volatility is a measure of volatility that is quite distinct from the historical volatility measure. The term implied volatility comes from the fact that the volatility is backed out from the market prices of options. That is to say given an option price, we can back out the implied volatility that must give this price using a model like Black Scholes. This can be done using a process of trial and error. More specifically the method that is used is known as the Newton-Raphson method.

### Newton-Raphson – The mathematics

You could of course take the methodology of the Newton-Raphson as a given and not worry about the detail, however if you are curious about the mathematics read the explanation below. This method is named for the great Isaac Newton and Joseph Raphson and is used to calculate better approximations to the the roots of functions. Let us look at a concrete example that will help to explain the process more clearly.

We have an equation that states :

So we are trying to find the value of x that gives us 45 when cubed. So lets start of with an estimate.

Our initial estimate is 4. No we can use the Newton-Raphson to solve this. First we need to express our equation sligthly differently to fit with this process. We need to find the value of the function when it is 0, that is:

So we express as :

Now we have set up the initial bit of the Newton-Raphson, lets show what we are trying to solve :

So to get the value for X1 we would have to sove the value for X0 first. Remember X0 has a starting guess of X = 4. This is shown below for i =0.

First we need to differentiate our Equation f(X0), which will give :

We can now substitute this back into the Newton-Raphson :

Substitute our guess of 4 into the equation and solve :

we can now work out the approximate error to get : (4 – 3.6041)/3.6041 = 10.98%. This is a pretty large error so we can iterate again as follows:

Now the error is: ( 3.6041 – 3.5575)/3.5575 = 1.31%. So lets iterate one more time to get the error down a bit more:

Now we get an answer that is 3.5568 and has a standard error of 0.02%. The cube of the number is 44.98, so this is a pretty good answer and we can accept it.

### Newton-Raphson for the Black-Scholes

The above is a very simple explanation of how the Newton-Raphson works. The great advantage of the Newton method is that it provides really fast convergence – notice how the error percentage fell so quickly. The same method is used to calculate the implied volatility and is generally quite a quick method. Th equation for the Black Scholes is as follows :

where:

- σ : is the implied volatility (start off with a guess as for the other example)
- P
_{m}is the Market price of the option (this is the value we are trying to solve to fit for) - P
_{t}is the theoretical value of the option given the implied vol plugged in

### Newton-Raphson for implied volatility : Implementation

Ideally this Newton Raphson problem would be solved in excel using VBA. We have included a spreadsheet here which implements the Newton Raphson in VBA. Its available for free download at the end of this article and you can look at the VBA code to see how it works.

You can download an Excel Spreadsheet with VBA for free containing the code to derive the implied volatility given the option price using the Newton-Raphson method. You will need to be a member of the site before you can download the file, you can sign for free very simply using your Facebook , twitter or google id.

You can download more spreadsheets on the subject of derivatives if you purchase the eBook for Amazon Kindle “Derivatives Explained”.

Read more about the mathematics of the Newton-Raphson on Wikipedia.

### One Comment

### Trackbacks/Pingbacks

- How to calculate Implied Volatility - ThinxLabs - […] a spreadsheet available for download that implments the Newton Raphson in VBA. Its available for free download from here, …

Thanks. FYI – on the download, both formulas are ‘puts’ (-1). In cell A2, change the last term in formula to ‘1’ instead of ‘-1′.