2014-02-16 21:46:12 +00:00
|
|
|
# European put option pricing using Heston method
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL 3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' European put option pricing using Heston method
|
|
|
|
#' @param strikeprice Strike price, relative to a unit stock price
|
|
|
|
#' @param dist.fn Distribution function for the risk neutral log-price process
|
|
|
|
#' @param ess.dist.fn Esscher transformed (with h=1) distribution function for the risk neutral log-price process
|
|
|
|
#' @param eval.time Evaluation time
|
|
|
|
#' @param expiry.time Expiry time
|
|
|
|
#' @param rate Continuously compounded interest rate (force of interest)
|
|
|
|
#' @param ... Parameters of the distribution function dist.fn
|
|
|
|
#' @return European put option price
|
2014-03-06 02:52:41 +00:00
|
|
|
#' @export putHeston
|
2014-02-16 21:46:12 +00:00
|
|
|
#' @author Francois Pelletier
|
2014-07-07 02:58:07 +00:00
|
|
|
putHeston <- function(param,strikeprice,dist.fn,eval.time,expiry.time,rate)
|
2014-02-16 21:46:12 +00:00
|
|
|
{
|
2014-07-07 02:58:07 +00:00
|
|
|
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)
|
2014-02-16 21:46:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|