Black Scholes surface vs Time to Maturity and Strike Price in R

256 Views Asked by At

I've just found out the "wireframe" function in R to plot 3D-surface graphs. I wish to implement it by plotting the Black&Scholes Call Option price against two sequence of data: Time to Maturity and Strike Price. So, first of all here follows my script so far:

S=100  #My stock Price
K=90   #Initial Strike Price
T=1    #Initial Time to Maturity (1 year here)
RF=0.03    #Risk free rate
SIGMA=0.2  #Volatility
d1=(log(S/K) + (RF + 0.5*SIGMA^2)*T)/SIGMA*sqrt(T)     #initial d(1)
d2=d1-SIGMA*sqrt(T)                                    #initial d(2)

Then I tried to prepare a grid for my surface/3D plot:

K=seq(80,120,1)
T=seq(0,1,0.1)
table=expand.grid(K,T)

Last step, I add a new column variable for computing my Call price according to every single combination:

table$CALL= S*pnorm(d1) - K*exp(-RF*T)*pnorm(d2)
names(table)= c("K","T","CALL")

Finally the surface/3D plot:

wireframe(CALL ~ K * T, scales = list( arrows = FALSE),aspect = c(1, .6),data=table,
      drape=T,shade=T)

So, it plots an apparently reliable graph (according to my finance study) but...I don't know, it looks a bit "scale-step" graph. As I'm a newbye in "wireframe" function, I don't know if I properly used all input data. I'd love an opinion to someone who already used to plot B&S formula in a 3D plot. I'm interested because I'd do the same to plot Greeks and Implied Volatility in the future.

Thanks in advance

0

There are 0 best solutions below