Tag Archives: European option

Binomial Tree methods for European options using GPU

Binomial methods are versatile in pricing options for it is suitable for American, European, and Asian options. With an European call option with maturity t, strike price k, spot price S, volatility σ, risk-free rate r:

binom1.1

For put option, the last effective term shall be in the max function shall be:
binomput2

Stock’s increment, decrements, and probability to move up are given by the below respectively:

binom2

One of the CUDA samples from Nvidia is to implement the binomial model on GPU.

binom3

 

Advertisements

Implied volatility in R

The R package RND computes the implied volatility for a Call option. A sample usage is given as below.

r-implied-volatility

The implied volatility based on the Black-Scholes model differs from realized volatility in that the latter is a retrospective estimate of price, while the former provides insight into the future.

Realized volatility can be derived from more traditional approach like standard deviation and GARCH models. Implied volatility, on the other hand, must be found numerically because the Black-Scholes formula cannot be solved for phi in terms of other parameters. A previous installment provides more mathematical details in TI Nspire.

Extracting Black-Scholes implied volatility in Nspire

The Black-Scholes model is an important pricing model for options. In its formula for European call option, the following parameters are required to create a function in the TI Nspire CX:

  • s – spot price
  • k – strike price
  • r – annual risk free interest rate
  • q – dividend yield
  • t – time to maturity
  • v – volatility

blackscholes-newton4

Now that the standard Black-Scholes formula is ready, a common method to derive the implied volatility numerically is to determine a value such that the squared loss function between observed price and calculated Black-Scholes price is zero. To derive this volatility, root finding method like the Newton-Raphson method can easily be implemented with advanced calculators like the TI Nspire. In fact, there is no need to code this feature by utilizing the built-in zeros() function of the CX CAS. This function solve for the selected variable from the input expression so that the result is zero, which is exactly what is needed in this case. The function implied_vola() below is coded to do the squared loss function, which is then passed into the CAS built-in zeros() function. Notice a warning of “Questionable accuracy” is reported for the zeros() function.

blackscholes-newton2

Doing the Newton-Raphson method is simple enough with the Nspire Program Editor. The program below bs_call_vnewtrap() takes a list of Black-Scholes parameters (including the s,k,r,q,t,v), an initial guess value of implied volatility, and the call price of the standard Black-Scholes formula. The last parameter is a precision control (value of zero default to a pre-set value). The last two attempts calling this function shown below depicts the effect of the precision control in this custom root-finding program.blackscholes-newton1

blackscholes-newton3