From 99f62ae46646b29128dc66b3e439b36d31c5e3ab Mon Sep 17 00:00:00 2001 From: francois Date: Sun, 6 Jul 2014 22:58:07 -0400 Subject: [PATCH] ajout Heston Normal --- .project | 1 + R/putHeston.R | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.project b/.project index e65c65b..ecb64bd 100644 --- a/.project +++ b/.project @@ -14,5 +14,6 @@ de.walware.statet.base.StatetNature de.walware.statet.r.RNature + de.walware.statet.r.RPkgNature diff --git a/R/putHeston.R b/R/putHeston.R index 6ef3a7f..da5d442 100644 --- a/R/putHeston.R +++ b/R/putHeston.R @@ -16,10 +16,16 @@ #' @return European put option price #' @export putHeston #' @author Francois Pelletier -putHeston <- function(strikeprice,dist.fn,ess.dist.fn,eval.time,expiry.time,rate,...) +putHeston <- function(param,strikeprice,dist.fn,eval.time,expiry.time,rate) { - exp(-rate*(expiry.time-eval.time)) * strikeprice*dist.fn(log(strikeprice),...) - - ess.dist.fn(log(strikeprice),...) + exp(-rate*(expiry.time-eval.time)) * strikeprice*dist.fn(log(strikeprice),param,hEsscher=0) - + dist.fn(log(strikeprice),param,hEsscher=1) +} + +putHestonSaddle <- function(param,strikeprice,dist.fn1,dist.fn2,eval.time,expiry.time,rate) +{ + exp(-rate*(expiry.time-eval.time)) * strikeprice*dist.fn1(log(strikeprice),param) - + dist.fn2(log(strikeprice),param) }