From 6deace89c801fa3344abc9c516a0193e39f7f13d Mon Sep 17 00:00:00 2001 From: franc00018 Date: Sat, 29 Mar 2014 12:37:15 -0400 Subject: [PATCH] =?UTF-8?q?modification=20int=C3=A9grale=20=C3=A0=20la=20f?= =?UTF-8?q?in=20de=20la=20fonction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/putEpps.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/putEpps.R b/R/putEpps.R index 7f32033..fbbcccb 100644 --- a/R/putEpps.R +++ b/R/putEpps.R @@ -21,18 +21,18 @@ putEpps <- function(strikeprice,char.fn,eval.time,expiry.time,rate,...,int.bounds=c(-Inf,Inf)) { # function to integrate (zhi) - zhi <- function(x,char.fn,strikeprice,eval.time,expiry.time,rate,...) + zhi <- function(x,char.fn,strikeprice,eval.time,expiry.time,...) { Re(strikeprice^{-1i*x} * - char.fn(x,eval.time,expiry.time,...) / + char.fn(x,expiry.time-eval.time,...) / (x*(1i+x))) } # function to integrate with strike price as first parameter - integrate.K <- function(strikeprice,zhi,int.bounds,eval.time,expiry.time,rate,...) + integrate.K <- function(strikeprice,zhi,char.fn,int.bounds,eval.time,expiry.time,rate,...) { exp(-rate*(expiry.time-eval.time)) * strikeprice * - (.5 - integrate(zhi,int.bounds[1],int.bounds[2],strikeprice,eval.time,expiry.time,rate,...)$value / (2*pi)) + (.5 - integrate(zhi,int.bounds[1],int.bounds[2],char.fn,strikeprice,eval.time,expiry.time,...)$value / (2*pi)) } - mclapply(as.list(strikeprice),integrate.K,zhi,int.bounds,eval.time,expiry.time,rate,...) + mclapply(as.list(strikeprice),integrate.K,zhi,char.fn,int.bounds,eval.time,expiry.time,rate,...) }