By Devang Singh

In this article, you will intuitively understand three Options pricing models. At the end of the post, we will also look at a Python library used to implement the Black Scholes model. Let us begin by understanding why options have value and what could be an intuitive way to understand how to compute this value.

**Understanding Options Premium**

Option premium can be compared to the insurance premium. In insurance, we pay a premium to save ourselves from potential losses in the future which might or might not occur. Similarly, a premium is paid to purchase an option to buy or sell the underlying, at some time in the future, if it is favourable for the option buyer to execute the option. To understand how to value an option, let us first look at understanding pricing a dice game.

You will get to roll a dice once, the amount of money that you receive, or the payoff, will depend on the number appearing on the upper surface of the dice. The payoff of the game is defined as the value greater of, either 0 or the number on the dice minus 3. Suppose you roll the dice and 5 appears on the upper surface. In this case, your payoff would be 5 minus 3 that is 2, because it is greater than 0. Then assume that you roll the dice and 2 appears on the upper surface. In this case, your payoff would be 0 because 0 is greater than minus 1, i.e. 2 minus 3. We will arrive at a fair price by evaluating the expected payoff from playing this game. The expected payoff will be calculated by summing up the product of the probability of an event and the payoff of the event.

In order to calculate a price for playing this game, we will compute the expected payoff from playing this game. The expected payoff will be calculated by summing up the product of the probability of an event and the payoff of the event.

**Probabilities of events:**

P(1) = P(2) = P(3) = P(4) = P(5) = P(6) = 1/6

**The payoff for events:**

Payoff(1) = Payoff(2) = Payoff(3) = 0 Payoff(4) = 1 Payoff(5) = 2 Payoff(6) = 3 Expected payoff = Σ P(x) . Payoff(x) x = 1 to 6 = 1/6 . 0 + 1/6 . 0 + 1/6 . 0 + 1/6 . 1 + 1/6 . 2 + 1/6 . 3 = 0 + 0 + 0 + 1/6 + 2/6 + 3/6 = 6/6 = 1

Therefore, the fair value of this game would be 1, any price greater than 1 would result in an advantage for the gamemaster and a price less than 1 would mean that the player is at an advantage, resulting in a loss for the gamemaster. For this reason, it is essential for the gamemaster to understand the fair value of pricing his game so that he is not at a statistical disadvantage by hosting the game.

Just like we calculated the fair value of the entry ticket for this game, the fair value of an option can also be calculated. However, while pricing an option it gets trickier compared to this simple example. As there are many prices that the underlying might cost at the time of expiration and secondly the probabilities of these prices is not as straightforward as the dice example.

**Black Scholes Model**

The Black Scholes Model estimates the prices of call and put options. Before looking at the formula, let us look at the payoff of a call option. Suppose the strike price is Rs 100 and the stock price is Rs 105, therefore the profit by exercising the option is Rs 5, gained by buying the stock at Rs 100 from the option seller and selling it at Rs 105 in the market. In other words, when we buy a call option, we pay the strike price and receive the stock price. Next, we need to understand that the option will only be exercised when the stock expires in the money. We will now compute the expected values of the two components.

The first component is payment of strike price given the stock ends in the money. The expected value will be equal to negative of the Strike Price (X) multiplied by the probability of Stock Price (S_{t}) being greater than Strike Price (X).

E(first component) = - X . P(S_{t}>X)

A negative sign indicates money is going out of our account.

The second component is the receipt of the stock price given that the stock ends in the money. The expected value of this term will be the stock price at the time of execution, multiplied by the probability of Stock Price (S_{t}) being greater than Strike Price (X).

E(second component) = E(S_{t}| S_{t}>X) . P(S_{t}>X)

Kindly note that the stock price at execution is given by the expected value of S_{t}, given that S_{t} is greater than X.

On combining these two terms we get the equation:

Intuitive formula: C_{t}= E(S_{t}| S_{t}>X) . P(S_{t}>X) - X . P(S_{t}>X) Black Scholes formula: C_{t}= S_{t}. N(d_{1}) - X . e^{-rt}. N(d_{2})

Where N is to denote the standard normal cumulative distribution function. d_{1} and d_{2} are variables that are defined as mentioned below, r is the risk-free interest rate and sigma is the volatility of returns of the underlying asset, S_{t} is the price of the underlying and X is the strike price of the option.

You can now compare the intuitive formula with the mathematical formula to see that intuitively we have understood the BSM model. It can be seen that the term N(d_{2}) can be compared to the probability of S_{t} being greater than X. There will be a slight difference in the N(d_{1}) term, which in addition to the probability of S_{t} being greater than X, will also have certain components from the expected value of S_{t} given that option expires in the money, from our intuitive formula.

**Derman Kani Model**

The Derman Kani model was developed to overcome the long-standing issue with the Black Scholes model, which is the volatility smile. One of the underlying assumptions of Black Scholes model is that the underlying follows a random walk with a constant volatility. However, on calculating the implied volatility for different strikes, it is seen that the volatility curve is not a constant straight line as we would expect, but instead has the shape of a smile. This curve of implied volatility against the strike price is known as the volatility smile. If the Black Scholes model is correct, it would mean that the underlying follows a lognormal distribution and the implied volatility curve would have been flat, but a volatility smile indicates that traders are implicitly attributing a unique non-lognormal distribution to the underlying. This non-lognormal distribution can be attributed to the underlying following a modified random walk, in the sense that the volatility is not constant and changes with both stock price and time. In order to correctly value the options, we would need to know the exact form of the modified random walk.

The Derman Kani model shows how to take the implied volatilities as inputs to deduce the form of the underlying’s random walk. More specifically a unique binomial tree is extracted from the smile corresponding to the random walk of the underlying, this tree is called the implied tree. This tree can be used to value other derivatives whose prices are not readily available from the market – for example, it can be used in standard but illiquid European options, American options, and exotic options.

**Heston Model**

Steven Heston provided a closed form solution for the price of a European call option on an asset with stochastic volatility. This model was also developed to take into consideration volatility smile, which could not be explained using the Black Scholes model. The basic assumption of the Heston model is that volatility is a random variable. Therefore there are two random variables, one for the underlying and one for the volatility. Generally, when the variance of the underlying has been made stochastic, closed form solutions will no longer exist. But this is a major advantage of the Heston model, that closed-form solutions do exist for European plain vanilla options. This feature also makes calibration of the model feasible.

If you are interested in learning about these models in more detail, you may go through the research papers “A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options” by Steven L. Heston for Heston Model, and “The Volatility Smile and Its Implied Tree” by Emanuel Derman and Iraj Kani for Derman Kani model.

Let us now look at a Python package which is used to implement the Black Scholes Model.

**Python Library – **Mibian

Mibian is an options pricing library implementing the Black-Scholes along with a couple other models for European options on currencies and stocks. In the context of this article, we are going to look at the Black-Scholes part of this library. Mibian is compatible with python 2.7 and 3.x. This library requires scipy to work properly.

The function which builds the Black-Scholes model in this library is the BS() function. The syntax for this function is as follows:

BS([underlyingPrice, strikePrice, interestRate, daysToExpiration], volatility=x, callPrice=y, putPrice=z)

The first input is a list containing the underlying price, strike price, interest rate and days to expiration. This list has to be specified each time the function is being called. Next, we input the volatility, if we are interested in computing the price of options and the option greeks. The BS function will only contain two arguments. If we are interested in computing the implied volatility, we will not input the volatility but instead will input either the call price or the put price. In case we are interested in computing the put-call parity, we will enter both the put price and call price after the list. The value returned would be (call price + price of the bond worth the strike price at maturity) – (put price + underlying asset price).

The syntax for returning the various desired outputs are mentioned below along with usage of the BS function.

The syntax for BS function with the input as volatility along with the list storing underlying price, strike price, interest rate and days to expiration:

c = mibian.BS([1.4565, 1.45, 1, 30], volatility=20)

Attributes of the returned value from the above-mentioned BS function:

c.callPrice Returns the call price c.putPrice Returns the put price c.callDelta Returns the call delta c.putDelta Returns the put delta c.callDelta2 Returns the call dual delta c.putDelta2 Returns the put dual delta c.callTheta Returns the call theta c.putTheta Returns the put theta c.callRho Returns the call rho c.putRho Returns the put rho c.vega Returns the option vega c.gamma Returns the option gamma

The syntax for BS function with the input as callPrice along with the list storing underlying price, strike price, interest rate and days to expiration:

c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359)

Attributes of the returned value from the above-mentioned BS function:

c.impliedVolatility Returns the implied volatility from the call price

The syntax for BS function with the input as putPrice along with the list storing underlying price, strike price, interest rate and days to expiration:

c = mibian.BS([1.4565, 1.45, 1, 30], putPrice=0.0306)

Attributes of the returned value from the above-mentioned BS function:

c.impliedVolatility Returns the implied volatility from the put price

The syntax for BS function with the inputs as callPrice and putPrice along with the list storing underlying price, strike price, interest rate and days to expiration:

c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359, putPrice=0.0306)

Attributes of the returned value from the above-mentioned BS function:

c.putCallParity Returns the put-call parity

**Conclusion**

We looked at three Options Pricing Models. The Black-Scholes formula was intuitively understood by computing the expected value of payoff. Later we saw how Derman and Kani worked upon eliminating the erroneous assumption of constant volatilities in the Black-Scholes model. They created a model by taking implied volatilities as inputs to form the underlying’s non-lognormal distribution. We then looked at the Heston Model, which considers volatility to be a stochastic random variable and provides closed-form solutions for European options. Finally, we understood how to use the Black-Scholes Model in Python for analyzing options using the Python package – Mibian.

**Next Step**

If you want to learn various aspects of Algorithmic trading then check out the Executive Programme in Algorithmic Trading (EPAT™). The course covers training modules like Statistics & Econometrics, Financial Computing & Technology, and Algorithmic & Quantitative Trading. EPAT™ equips you with the required skill sets to be a successful trader. Enroll now!

Alternatively, you can opt for our short-term course series. A 3-course bundle on ‘Options Trading Strategies in Python’ covers Basic, Intermediate and Advanced strategies. Developed in association with NSE Academy. The bundle offers a 30% discount, click here to know more.

*Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.*