Small classes and routines used in project. More...
Classes | |
class | marian::DataFrame |
Class used to handle data. More... | |
class | marian::DataEntryClerk |
Class used to provide data to julian::DataFrame. More... | |
class | marian::SmartPointer< T > |
Template of deep-coping smart pointer. More... | |
Enumerations | |
enum | marian::OptionType { marian::OptionType::PUT = -1, marian::OptionType::CALL = 1 } |
Types of options. More... | |
Functions | |
double | marian::normalCDF (double t) |
Normal CDF. More... | |
double | marian::interpolation (const std::vector< double > &x, const std::vector< double > &y, double t) |
linear local interpolation More... | |
std::map< std::string, EuroOpt > | marian::createEuroOpts (DataFrame df) |
Converts data stored in dataframe to European option. More... | |
std::map< std::string, Market > | marian::createMarkets (DataFrame df) |
Converts data stored in dataframe to market data. More... | |
ConvectionDiffusion | marian::mkt2process (Market mkt) |
Converts the option market data to diffusion process. More... | |
Detailed Description
Enumeration Type Documentation
|
strong |
Function Documentation
std::map< std::string, EuroOpt > marian::createEuroOpts | ( | DataFrame | df | ) |
Data frame should contain following columns:
- Id: String identification
- Strike: double number representing strike
- Tenor: double number representing tenor of option
- Type: 'C' or 'P'
- Parameters
-
df Dataframe containing parametrization of European options
- Returns
- Map with options as values and ids as map's keys.
- Examples:
- EuroOptExample.cpp.
std::map< std::string, Market > marian::createMarkets | ( | DataFrame | df | ) |
Data frame should contain following columns:
- Id: String identification
- Spot: double number representing value of underlying
- Vol: double number representing volatility
- Rate: double number representing the risk free interest rate
- Parameters
-
df Dataframe containing parametrization of market
- Returns
- Map with options as values and ids as map's keys.
- Examples:
- EuroOptExample.cpp.
double marian::interpolation | ( | const std::vector< double > & | x, |
const std::vector< double > & | y, | ||
double | t | ||
) |
The idea of linear interpolation of set of point is to approximate value at a point
by a straight line passing through two data points
and
closest to
. The formula for linear interpolation is:
- Parameters
-
x Vector of arguments y Vector of values corresponding to arguments t Intermediate point
- Returns
- Value of interpolant for t
- Precondition
- x,y vector must be sorted.
- Note
- Interpolation is only defined for interval defined by the first and the last argument given. The interpolation objects do not extrapolate values outside the interval.
ConvectionDiffusion marian::mkt2process | ( | Market | mkt | ) |
The data defining : asset price, risk free rate and volatility of asset price. Under the assumptions of Black-Scholes model (see [4]) the price of derivative instruments satisfies the equation:
where: is the price of derivative,
asset price,
volatility and
is risk free rate.
After applying transformation the PDE will have a form:
Above PDE is a Backward Kolmogorov Equation associated with stochastic process: diffusion term , convection term
and decay term
.
double marian::normalCDF | ( | double | t | ) |
Function calculates Cumulative Distribution Function for standard normal distribution.
Algorithm is basing on ERF function and its relation to Standard Normal Distribution (see formula 7.1.26 in [12])
- Parameters
-
t argument.
- Returns
- Normal CDF for t