The Financial Modeling package is a collection of tools for mathematical finance. This package builds on the functionality available in other packages such as LinearAlgebra, Statistics, Optimization, and CurveFitting. The package supports a wide range of common tasks such as date arithmetic, cash flow analysis, option pricing, term structure analysis, and simulation.
For more finance examples and applications, see the Finance start page.

Cash Flow Analysis


The Financial Modeling package provides a number of tools for constructing cash flows and for performing basic sensitivity analysis.
More information and detailed examples can be found in Finance/Overview/CashFlowAnalysis.


Date Arithmetic


The Financial Modeling package provides various commands for performing date arithmetic. In particular, it supports over 20 different calendars and 15 day count conventions. In addition, the package provides tools for modifying existing calendars and creating nonstandard calendars.
AddHoliday



add a holiday to the given calendar

AdjustDate



adjust a nonbusiness day according to the given convention

AdvanceDate



advance a nonbusiness day according to the given convention

Calendar



create a new calendar

DayCount



return the number of days between two dates according to a given convention

DayCounter



advance to the nth given day of the given month

DayOfWeek



return the day of the week on which the given date falls

EvaluationDate



return the global evaluation date

FormatDate



return a string containing formatted date

IsBusinessDay



check if a given date is a business day according to a given calendar

IsEndOfMonth



check if a given date corresponds to the end of a month according to a given calendar

IsHoliday



check if a given date is a holiday according to a given calendar

JoinBusinessDays



construct new calendar by joining business days from the given two calendars

JoinHolidays



construct new calendar by joining holidays from the given two calendars

NextWeekday



advance the given date to the next given day of the week

NthWeekday



advance to the nth given day of the given month

ParseDate



parse a string containing date information

RemoveHoliday



remove a holiday from the given calendar

SetEvaluationDate



set the global evaluation date

Settings



return default settings

TimeGrid



return an object for time discretization

TodaysDate



return today's date according to the system clock

YearFraction



return the interval between two dates as a fraction of a year according to a given convention



More information and detailed examples can be found in Finance/Overview/Calendars and Finance/Overview/DayCounters.


Financial Instruments


The Financial Modeling package provides tools for constructing various financial instruments such as Europeanstyle and Americanstyle options with any payoff function, bonds, as well as some interest rate instruments. In addition to this, the package provides tools for valuing these instruments and computing their market sensitivities (the Greeks). The following instruments are supported.
The following tools are available for working with the above instruments.
BlackPrice



calculate the price of an interest rate instrument using the Black model

BlackScholesCharm



calculate the Charm of a Europeanstyle option in the BlackScholes model

BlackScholesColor



calculate the Color of a Europeanstyle option in the BlackScholes model

BlackScholesDelta



calculate the Delta of a Europeanstyle option in the BlackScholes model

BlackScholesGamma



calculate the Gamma of a Europeanstyle option in the BlackScholes model

BlackScholesLambda



calculate the Lambda of a Europeanstyle option in the BlackScholes model

BlackScholesPrice



calculate the price of a Europeanstyle option using the BlackScholes model

BlackScholesRho



calculate the Rho of a Europeanstyle option in the BlackScholes model

BlackScholesSpeed



calculate the Speed of a Europeanstyle option in the BlackScholes model

BlackScholesTheta



calculate the Theta of a Europeanstyle option in the BlackScholes model

BlackScholesUltima



calculate the Ultima of a Europeanstyle option in the BlackScholes model

BlackScholesVanna



calculate the Vanna of a Europeanstyle option in the BlackScholes model

BlackScholesVega



calculate the Vega of a Europeanstyle option in the BlackScholes model

BlackScholesVera



calculate the Vera of a Europeanstyle option in the BlackScholes model

BlackScholesVeta



calculate the Veta of a Europeanstyle option in the BlackScholes model

BlackScholesVomma



calculate the Vomma of a Europeanstyle option in the BlackScholes model

BlackScholesZomma



calculate the Zomma of a Europeanstyle option in the BlackScholes model

BondOptionPrice



calculate the price of a discount bond option in the given affine shortrate model

CleanPrice



calculate the clean price of a bond

Convexity



calculate the convexity of a bond

DirtyPrice



calculate the dirty price of a bond

DiscountBondPrice



calculate a discount bond price

Duration



calculate the duration of a bond

ImpliedVolatility



calculate the implied volatility of a Europeanstyle option in the BlackScholes model

ImpliedVolatilitySurface



construct a volatility term structure

LatticePrice



calculate the price of a financial instrument using a binomial or a trinomial tree

LocalVolatility



calculate the local volatility of a Europeanstyle option

LocalVolatilitySurface



create new local volatility term structure

Schedule



define a new payment schedule

YieldFromCleanPrice



calculate the yield of a bond using its clean price

YieldFromDirtyPrice



calculate the yield of a bond using its dirty price



More information and detailed examples can be found in Finance/Examples/EuropeanOptions, and Finance/Examples/AsianOptions.


Interest Rates


The Finance package also provides tools for creating and manipulating term structures of interest rates as well as volatility term structures. Here is the list of relevant commands:
BenchmarkRate



calculate benchmark rate based on a specified calendar

CompoundFactor



return a compound factor for the specified date or time

DiscountCurve



construct a yield curve based on known discount rates

DiscountFactor



return a discount factor for the specified date or time

EquivalentRate



calculate equivalent interest rate

FairRate



return the fair rate of an interest rate swap

FairSpread



return the fair spread of an interest rate swap

ForwardRate



compute forward rates based on a given term structure

ForwardCurve



construct a yield curve based on known forward rates

ImpliedRate



calculate interest rate implied by a given compound factor

LoadHistory



load historic date for a given benchmark rate

ParRate



compute par rates based on a given term structure

ZeroCurve



construct a yield curve based on known zero rates

ZeroRate



compute zero rates based on a given term structure



More information and detailed examples can be found in Finance/Overview/TermStructures.


Lattice Methods


The Financial Modeling package also provides tools for constructing binomial and trinomial trees.
The following commands can be used to inspect/manipulate a tree data structure.
GetDescendants



return descendants for a node of a binomial or trinomial tree

GetLocalVolatility



return the local volatility node of a BlackScholes binomial or trinomial tree

GetProbabilities



return probabilities for a node of a binomial or trinomial tree

GetSize



get the size of a binomial/trinomial tree at the given level

GetUnderlying



return the value of the underlying for a node of a binomial or trinomial tree

SetProbabilities



set probabilities for a node of a binomial or trinomial tree

SetUnderlying



set the value of the underlying for a node of a binomial or trinomial tree



More information and detailed examples can be found in Finance/Overview/LatticeMethods.


Short Rate Models


The Financial Modeling package provides the following short rate models.


Stochastic Processes


The Financial Modeling package supports a wide range of stochastic processes used in Financial Engineering. This includes processes for modeling equity prices, meanreverting processes, pure jump processes, jump diffusions as well as multivariate Ito processes. In addition, the package provides tools for building more complicated processes from simple ones. Below is the list of supported processes:
Here are some related commands.
Diffusion



compute the diffusion component of an Ito process

Drift



compute the drift component of an Ito process

ExpectedShortfall



calculate the expected shortfall

ExpectedValue



compute a Monte Carlo estimate of the specified expression

PathGenerator



create new path generator for the specified stochastic process

PathPlot



plot sample path(s) of the specified stochastic process

SamplePath



generate a sample path for the specified stochastic process

SampleValues



generate sample values for the specified stochastic process

ValueAtRisk



estimate valueatrisk for the specified expression



More information and detailed examples can be found in Finance/Overview/StochasticProcesses.
