Ajout de la fonction putHeston et putEpps

This commit is contained in:
François Pelletier 2014-02-16 16:46:12 -05:00
parent 61bf3d4ba6
commit 44d70ed830
4 changed files with 69 additions and 6 deletions

View file

@ -8,8 +8,8 @@
#' European put option pricing using characteristic function
#'
#' As seen in Epps (2009)
#' @param char.fn Characteristic function of the price level at expiry time
#' @param strikeprice Strike price, relative to a unit stock price
#' @param char.fn Characteristic function of the price level at expiry time
#' @param eval.time Evaluation time
#' @param expiry.time Expiry time
#' @param rate Continuously compounded interest rate (force of interest)
@ -18,7 +18,7 @@
#' @return European put option price
#'
#' @author Francois Pelletier
putEpps <- function(char.fn,strikeprice,eval.time,expiry.time,rate,...,int.bounds=c(-Inf,Inf))
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,...)

26
R/putHeston.R Normal file
View file

@ -0,0 +1,26 @@
# 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
#'
#' @author Francois Pelletier
putHeston <- function(strikeprice,dist.fn,ess.dist.fn,eval.time,expiry.time,rate,...)
{
exp(-rate*(expiry.time-eval.time)) * strikeprice*dist.fn(log(strikeprice),...) -
ess.dist.fn(log(strikeprice),...)
}

View file

@ -2,16 +2,16 @@
\alias{putEpps}
\title{European put option pricing using characteristic function}
\usage{
putEpps(char.fn, strikeprice, eval.time, expiry.time, rate, ...,
putEpps(strikeprice, char.fn, eval.time, expiry.time, rate, ...,
int.bounds = c(-Inf, Inf))
}
\arguments{
\item{char.fn}{Characteristic function of the price level
at expiry time}
\item{strikeprice}{Strike price, relative to a unit stock
price}
\item{char.fn}{Characteristic function of the price level
at expiry time}
\item{eval.time}{Evaluation time}
\item{expiry.time}{Expiry time}

37
man/putHeston.Rd Normal file
View file

@ -0,0 +1,37 @@
\name{putHeston}
\alias{putHeston}
\title{European put option pricing using Heston method}
\usage{
putHeston(strikeprice, dist.fn, ess.dist.fn, eval.time, expiry.time, rate, ...)
}
\arguments{
\item{strikeprice}{Strike price, relative to a unit stock
price}
\item{dist.fn}{Distribution function for the risk neutral
log-price process}
\item{ess.dist.fn}{Esscher transformed (with h=1)
distribution function for the risk neutral log-price
process}
\item{eval.time}{Evaluation time}
\item{expiry.time}{Expiry time}
\item{rate}{Continuously compounded interest rate (force
of interest)}
\item{...}{Parameters of the distribution function
dist.fn}
}
\value{
European put option price
}
\description{
European put option pricing using Heston method
}
\author{
Francois Pelletier
}