Nonparametric estimation in quadratic hedging

Introduction

This is the home page of the article "Nonparametric estimation in quadratic hedging", written by Jussi Klemelä.

Abstract of the article

We construct nonparametric estimators of hedging coefficients of a European option when quadratic hedging is applied. In quadratic hedging the hedging coefficients are chosen so that the mean squared hedging error is minimized. We define two statistical estimators applying kernel regression. The first estimator is better when the distribution of the stock price is heavy-tailed, and the second estimator is better when the distribution is light-tailed. We prove consistency of the estimators and derive rates of convergence of the estimators. In addition, we derive rates of convergence of the mean squared hedging error.

Reproducing the computations

Install software

source("http://jklm.fi/art/quadhedge/quadhedge.R")
source("http://jklm.fi/finatool/finatool.R")
source("http://jklm.fi/regpro/regpro.R")

Read SP500 Data

				      
file<-"http://jklm.fi/statopti/GSPC.csv"
gspc0<-read.csv(file=file)
gspc<-gspc0[,6]
prices<-gspc[2:length(gspc)]
		
n<-length(prices)
times<-matrix(0,n,1)
delta<-1/251.63
alku<-1950+0/12
for (i in 1:length(times)) times[i]<-alku+(i-1)*delta  
				      
retu<-log(gspc[2:length(gspc)]/gspc[1:(length(gspc)-1)])

Read Volatility

file<-"/home/jsk/Arti/statopti/var/garch-sp500-log-roll.var"
#list=c("sigmat","alpha0t","alpha1t","betat"))
load(file=file)

Estimator using differences: Compute quadratic hedging coefficients

	
S<-100
r<-0	
T<-2
           
h<-0.7       
h2<-0.7

x1<-seq(96,104,1)              # price range
x2<-seq(-5.5,-3,0.1)	       # range of logarithmic volatility
xx2<-exp(x2)*sqrt(250)         # range of annualized volatility
koot<-seq(95,100)              # range of strike prices

mata<-matrix(0,length(x2),length(koot))
mata1<-matrix(0,length(x2),length(koot))
mata2<-matrix(0,length(x2),length(koot))
mata3<-matrix(0,length(x2),length(koot))
mata11n<-matrix(0,n,length(koot))
mata12n<-matrix(0,n,length(koot))
mata13n<-matrix(0,n,length(koot))
mata14n<-matrix(0,n,length(koot))
mataK1n<-matrix(0,n,length(koot))
mataH1n<-matrix(0,n,length(koot))
for (kk in 1:length(koot)){
    K<-koot[kk]
    V0<-bs(S,K,v=sd(retu)*sqrt(250),r=0,t=T/360,type="put")
    op<-twoperiod(K=K,S=S,r=0,h=h,h2=h2,x1=x1,x2=x2,V0=V0,
    prices=prices,sigmat=sigmat)
    mata[,kk]<-op$xi
    mata1[,kk]<-op$f01
    mata2[,kk]<-op$f02
    mata3[,kk]<-op$f03
    mata11n[,kk]<-op$f11n
    mata12n[,kk]<-op$f12n
    mata13n[,kk]<-op$f13n
    mata14n[,kk]<-op$f14n
    mataK1n[,kk]<-op$K1n
    mataH1n[,kk]<-op$H1n
}

mata.diffe<-mata
mata2.diffe<-mata2
mata3.diffe<-mata3
		   

Estimator using returns: Compute quadratic hedging coefficients

S<-100
r<-0	
T<-2
           
h<-0.7       
h2<-0.7

x1<-seq(96,104,1)              # price range
x2<-seq(-5.5,-3,0.1)	       # range of logarithmic volatility
xx2<-exp(x2)*sqrt(250)         # range of annualized volatility
koot<-seq(95,100)              # range of strike prices

koot<-seq(95,100)
mata<-matrix(0,length(x2),length(koot))
mata1<-matrix(0,length(x2),length(koot))
mata2<-matrix(0,length(x2),length(koot))
mata3<-matrix(0,length(x2),length(koot))
mata11n<-matrix(0,n,length(koot))
mata12n<-matrix(0,n,length(koot))
mata13n<-matrix(0,n,length(koot))
mata14n<-matrix(0,n,length(koot))
mataK1n<-matrix(0,n,length(koot))
mataH1n<-matrix(0,n,length(koot))
for (kk in 1:length(koot)){
    K<-koot[kk]
    V0<-bs(S,K,v=sd(retu)*sqrt(250),r=0,t=T/360,type="put")
    op<-twoperiod.retu(K=K,S=S,r=0,h=h,h2=h2,x1=x2,V0=V0,
    prices=prices,sigmat=sigmat)
    mata[,kk]<-op$xi
    mata1[,kk]<-op$f01
    mata2[,kk]<-op$f02
    mata3[,kk]<-op$f03
    mata11n[,kk]<-op$f11n
    mata12n[,kk]<-op$f12n
    mata13n[,kk]<-op$f13n
    mata14n[,kk]<-op$f14n
    mataK1n[,kk]<-op$K1n
    mataH1n[,kk]<-op$H1n
}

mata.retu<-mata
mata2.retu<-mata2
mata3.retu<-mata3

Figure 1

			       
# compute Black-Scholes hedging coefficients 
      
matab<-matrix(0,length(x2),length(koot))
for (kk in 1:length(koot)){
    K<-koot[kk]
    deltas<-matrix(0,length(x2),1)
    for (i in 1:length(x2)){      
        vee<-xx2[i]
        deltas[i]<-bs.delta(S,K,v=vee,r=0,t=T/360,type="put")
    }
    matab[,kk]<-deltas
}
		 
# Figure 1

cex.axis<-1.5
cex.lab<-1.5
cex.sub<-1.5
cex<-1.5
lty<-1.5

# Panel (a)      
matplot(xx2,mata.retu,type="l",lty=1,col="red",
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
for (kk in 1:length(koot)){
    ind<-23
    text(xx2[ind],mata.retu[ind,kk],as.character(koot[kk]),cex=cex,col="red")
}     
matplot(xx2,mata.diffe,type="l",lty=1,col="blue",add=TRUE,
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
for (kk in 1:length(koot)){
    ind<-25
    text(xx2[ind],mata.diffe[ind,kk],as.character(koot[kk]),cex=cex,col="blue")
}	  
mtext("volatility",side=1,cex=1.5,line=2.4)
title(sub="(a)",cex.sub=cex.sub)

# Panel (b)	  
matplot(xx2,matab,type="l",lty=1,col="black",
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
mtext("volatility",side=1,cex=1.5,line=2.4)
for (kk in 1:length(koot)){
    ind<-22
    text(xx2[ind],matab[ind,kk],as.character(koot[kk]),cex=cex,col="black")
}
title(sub="(b)",cex.sub=cex.sub)
    				     

Figure 2

	     
cex.axis<-1.5
cex.lab<-1.5
cex.sub<-1.5
cex<-1.5
lty<-1.5

# Panel (a)      
plot(xx2,S^2*mata2.retu[,1],type="l",lty=1,col="red",
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
matplot(xx2,mata2.diffe[,1],type="l",lty=1,col="blue",add=TRUE,
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
mtext("volatility",side=1,cex=1.5,line=2.4)
title(sub="(a)",cex.sub=cex.sub)

# Panel (b)      
matplot(xx2,S*mata3.retu,type="l",lty=1,col="red",
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
mtext("volatility",side=1,cex=1.5,line=2.4)
for (kk in 1:length(koot)){
    ind<-26
    text(xx2[ind],S*mata3.retu[ind,kk],as.character(koot[kk]),cex=cex,col="red")
}
matplot(xx2,mata3.diffe,type="l",lty=1,col="blue",add=TRUE,
xlab="",ylab="",cex=cex,cex.axis=cex.axis,cex.lab=cex.lab)
mtext("volatility",side=1,cex=1.5,line=2.4)
for (kk in 1:length(koot)){
   ind<-25
   text(xx2[ind],mata3.diffe[ind,kk],as.character(koot[kk]),cex=cex,col="blue")
}
title(sub="(b)",cex.sub=cex.sub)
		  

June 2020