2014-02-22 18:30:49 +00:00
|
|
|
# Damped characteristic function of the call option log-price
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL 3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
#' Damped characteristic function of the call option log-price
|
|
|
|
#' @param u Transform variate
|
|
|
|
#' @param char.fn Characteristic function of the log-price process
|
|
|
|
#' @param eval.time Evaluation time
|
|
|
|
#' @param expiry.time Expiry time
|
|
|
|
#' @param rate Continuously compounded interest rate (force of interest)
|
|
|
|
#' @param alpha Damping parameter
|
|
|
|
#' @param ... Parameters of the characteristic function
|
|
|
|
#' @param moneyness Boolean for moneyness of call option
|
|
|
|
#' (TRUE if strike price is lower than stock price)
|
|
|
|
#' @return Characteristic function value
|
2014-03-06 02:52:41 +00:00
|
|
|
#' @export dampedcfcallCarrMadan
|
2014-02-22 18:30:49 +00:00
|
|
|
#' @author Francois Pelletier
|
|
|
|
dampedcfcallCarrMadan <- function(u,char.fn,eval.time,expiry.time,rate,alpha,...,moneyness=TRUE)
|
|
|
|
{
|
|
|
|
if(moneyness)
|
|
|
|
{
|
2014-03-06 02:52:41 +00:00
|
|
|
return(exp(-rate*(expiry.time-eval.time))*
|
2014-02-22 18:30:49 +00:00
|
|
|
char.fn(u-1i*(alpha+1),expiry.time-eval.time,...) /
|
2014-03-06 02:52:41 +00:00
|
|
|
(alpha^2+alpha-u^2+1i*u*(2*alpha+1)))
|
2014-02-22 18:30:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
auxiliairyf <- function(u,char.fn,eval.time,expiry.time,rate,alpha,...)
|
|
|
|
{
|
|
|
|
exp(-rate*(expiry.time-eval.time))*
|
|
|
|
(1/(1+1i*u)-exp(rate*(expiry.time-eval.time))/
|
|
|
|
(1i*u)-char.fn(u-1i,expiry.time-eval.time,...)/(u^2-1i*u))
|
|
|
|
}
|
2014-03-06 02:52:41 +00:00
|
|
|
return((auxiliairyf(u-1i*alpha,char.fn,eval.time,expiry.time,rate,alpha,...)-
|
|
|
|
auxiliairyf(u+1i*alpha,char.fn,eval.time,expiry.time,rate,alpha,...))/2)
|
2014-02-22 18:30:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|