# [R-SIG-Finance] Implied Probability Distribution

Ravi S. Shankar ravis at ambaresearch.com
Thu Aug 30 10:42:36 CEST 2007

```Hi R users,

First let me thank Krishna and Anup.

Based on the suggestions I have given the r code along with the sample
data.

Sample data of the nifty index call options that I am using.

Date	Expiry	Strike	Price	spot	InterestRate	Time_Mat
6/28/2002	25/07/2002	1090	7.5	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1120	2.25	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1110	3.5	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1100	5.65	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1080	9.55	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1070	13	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1060	17.7	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1050	23.35	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1040	28.1	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1020	45	1057.8	0.0698
0.075396825
6/28/2002	25/07/2002	1030	38.5	1057.8	0.0698
0.075396825

And the sample code that I am using.

n<-length(indexdata[,6])
impvol=delta=0
for(i in 1:n)
{
impvol[i]<-GBSVolatility(indexdata[i,4],"c",indexdata[i,5],indexdata[i,3
],indexdata[i,7],indexdata[i,6],0,0.0001,10000)
}
indexdata<-data.frame(indexdata,impvol)
for(i in 1:n)
{

delta[i]<-GBSGreeks("delta","c",indexdata[i,5],indexdata[i,3],indexdata[
i,7],indexdata[i,6],0,indexdata[i,8])
}
indexdata<-data.frame(indexdata,delta)
tt<-splinefun(indexdata\$delta,indexdata\$impvol,method="natural",ties="me
an")
splinecoef <- get("z", envir = environment(tt))

k<-indexdata\$spot*exp(((indexdata\$InterestRate)+0.5*(splinecoef\$y)^2)*(i
ndexdata\$Time_Mat)-(qnorm(splinecoef\$x)*(splinecoef\$y)*sqrt(indexdata\$Ti
me_Mat)))
call_price<-GBSOption(TypeFlag = "c", S = indexdata[1,5], X =k, Time
=indexdata[1,7], r =indexdata[1,6], b = 0, sigma =splinecoef\$y)
hh<-data.frame(indexdata\$Strike,indexdata\$Price,indexdata\$spot)
mm<-data.frame(k,call_price at price,indexdata\$spot)
final_data<-data.frame(rbind(as.matrix(hh),as.matrix(mm)))
final_data1<-final_data[order(final_data\$indexdata.Strike),]
i=final_data1\$indexdata.spot-final_data1\$indexdata.Strike
final_data1<-data.frame(final_data1,i)
c2<-final_data1[(order(abs(final_data1[,4]))[1]),2]
c3<-final_data1[((order(abs(final_data1[,4]))[1])+1),2]
c1<-final_data1[((order(abs(final_data1[,4]))[1])-1),2]
imp_prob<-exp(indexdata[1,6]*indexdata[1,7])*((c1+c3-(2*c2))/16)

Now I have the following question:

The differences between the strikes are not even. I have used (4)^2 in
computing imp_prob.

Please tell me if I am proceeding in the correct direction in my
computing of implied probability.

Regards,

Ravi Shankar S

-----Original Message-----
From: Krishna Kumar [mailto:kriskumar at earthlink.net]
Sent: Wednesday, August 22, 2007 7:37 AM
To: Ravi S. Shankar
Cc: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Implied Probability Distribution

> Using non overlapping data of one month call option I have estimated
the
> implied volatility using the GBSVolatility of fOptions. Using these
> implied volatilities I have obtained delta using GBSGreeks of the same
> package.
>
> Using the natural splines I have plotted the implied volatility and
> delta.
>
>
>
> I have two questions (this might be trivial but would be glad for
> insight):
>
> 1) How do I extrapolate to obtain the tail?
>
I am afraid there is no easy answer to this either you could flat
forward extrapolate or use your fitted functional form/spline to
extrapolate and obtain the vols for those strikes in the wings.
Stability is the key and using something that is too flexible could
sometimes hurt in this case.

> 2) How do I back out the option price? (We can use the Black- Scholes
> model (GBSOption of fOptions), however my understanding is it requires
> implied volatility and strike, but we have implied volatility and
delta)
>
>
>
I couldn't find a version of the Breeden & Litzenberger paper but here
is an easy read on this use eqn 3 on Page-4.

In essence you use a continuum of Call prices and take the 2nd
derivative with respect to Strike(K) and for this take the centered
difference
for starters there are some higher order differences that you can mess
with later.

Also if you have the delta you can always map that to a strike K using
the formula in http://www.mathfinance.org/formulas_u/Vanilla/node20.html
If you need further help it would help if you provide further
information and possibly the data that you are using for this list to be

of further help.

Best
Krishna

>
>
> Thank you in advance for the help.
>
> Regards,
>
> Ravi
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>

```