#source("RP.smile.R") source("BlackScholesFormula.R") source("RP.SVJ.R") n.paths<-10^4 n.obspoints<-126 n.euler<-5 spot<-100 strike<-110 timetomat<-0.25 R<-0.02 V<-0.04 kappa.V<-2.03 theta.V<-0.04 sigma.V<-0.38 rho<--0.57 mu.J<--0.09 sigma.J<-0.14 lambda<-0.5 putfwdmoneyness<-impvol<-matrix(0,nrow=4,ncol=31) for(j in 1:4){ for (i in 0:30) { putfwdmoneyness[j,i+1]<-((85+i)*exp(R*timetomat*(j/4)) -spot)/spot callprice<-RP.SVJcall(spot,(85+i),timetomat*(j/4),R,V,kappa.V,theta.V,sigma.V,rho,mu.J,sigma.J,lambda) impvol[j,i+1]<-BlackScholesImpVol (callprice,spot,timetomat*(j/4),(85+i),R,q=0,opttype= 1) } } plot(putfwdmoneyness[1,], impvol[1,], type='l', lty=1) points(putfwdmoneyness[2,], impvol[2,], type='l', lty=2) points(putfwdmoneyness[3,], impvol[3,], type='l', lty=3) points(putfwdmoneyness[4,], impvol[4,], type='l', lty=4) histvol<-sqrt(V+lambda*(mu.J^2+(1+mu.J)^2*(exp(sigma.J^2)-1))) abline(h=histvol,lty=2)