Overview of the Finance Package
Calling Sequence
Description
Finance:command(arguments)
command(arguments)
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.
Cash Flow Analysis
The Financial Modeling package provides a number of tools for constructing cash flows and for performing basic sensitivity analysis.
AccruedAmount

calculate the accrued amount of a bond
BasisPointSensitivity
calculate the basis point sensitivity of future cash flows
CashFlows
return the set of cash flows for a bond or a swap
CleanPrice
calculate the clean price of a bond
Convexity
calculate the convexity of a bond or a set of cash flows
DirtyPrice
calculate the dirty price of a bond
Duration
calculate the duration of a bond or a set of cash flows
FixedRateCoupon
construct a fixedrate coupon on a term structure
InArrearIndexedCoupon
construct an inarrear indexed coupon
InternalRateOfReturn
calculate the internal rate of return of a set of cash flows or a bond
NetPresentValue
return the net present value of future cash flows
ParCoupon
construct a coupon at par on a term structure
SimpleCashFlow
construct a simple cash flow at a given date
UpFrontIndexedCoupon
construct an upfront indexed coupon on a term structure
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
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.
AmericanOption
construct an Americanstyle option with the specified payoff function
AmericanSwaption
construct an Americanstyle swaption
BermudanOption
construct a Bermudanstyle option with the specified payoff function
BermudanSwaption
construct a Bermudanstyle swaption
Cap
create new interest rate cap
Collar
create new interest rate collar
EuropeanOption
construct a Europeanstyle option with the specified payoff function
EuropeanSwaption
construct a Europeanstyle swaption
FixedCouponBond
create new fixedcoupon bond
FloatingRateBond
create new floatingrate bond
Floor
create new interest rate floor
InterestRateSwap
create new interest rate swap
Swap
create new cashflow swap
ZeroCouponBond
create new zerocoupon bond
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
calculate the convexity of a bond
DiscountBondPrice
calculate a discount bond price
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.
BinomialTree
construct a recombining binomial tree data structure
BlackScholesBinomialTree
create a recombining binomial tree for a BlackScholes process
BlackScholesTrinomialTree
create a recombining trinomial tree for a BlackScholes process
ImpliedBinomialTree
construct an implied BlackScholes binomial tree
ImpliedTrinomialTree
construct an implied BlackScholes trinomial tree
ShortRateTree
construct a trinomial tree for a shortrate process
TreePlot
plot a binomial or trinomial tree
TrinomialTree
construct a mutable recombining tree data structure
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.
Personal Finance
amortization
amortization table for a loan
annuity
present value of an annuity
blackscholes
present value of a call option
cashflows
present value of a list of cash flows
effectiverate
convert a stated rate to the effective rate
futurevalue
future value of an amount
growingannuity
present value of a growing annuity
growingperpetuity
present value of a growing perpetuity
levelcoupon
present value of a level coupon bond
perpetuity
present value of a perpetuity
presentvalue
present value of an amount
yieldtomaturity
yield to maturity of a level coupon bond
More information and detailed examples can be found in the Personal Finance example worksheet.
Short Rate Models
The Financial Modeling package provides the following short rate models.
CoxIngersollRossModel
CoxIngersollRoss interest rate model
HullWhiteModel
HullWhite interest rate model
VasicekModel
Vasicek interest rate model
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:
BlackScholesProcess
BlackScholes process
BrownianMotion
uni or multivariate Brownian motion
CEVProcess
constant elasticity of variance (CEV) process
DeterministicProcess
deterministic timedependent process
DynamicPortfolio
a portfolio of stochastic processes which can be dynamically rebalanced
MarkovChain
a finite state Markov chain
GammaProcess
gamma process
GaussMarkovProcess
Gaussian process for modeling shortterm interest rate
GeometricBrownianMotion
geometric Brownian motion
HestonProcess
stochastic volatility process introduced by Heston
ItoDiffusion
general uni or multivariate Ito process defined by drift and diffusion
ItoProcess
Ito process
MertonJumpDiffusion
jumpdiffusion process introduced by Merton
RegimeSwitchingProcess
stochastic process with multiple regimes
OrnsteinUhlenbeckProcess
OrnsteinUhlenbeck process
PoissonProcess
Poisson process including the doublystochastic Poisson (Cox) process
ShortRateProcess
process that governs a short rate
SquareRootDiffusion
squareroot diffusion
SVJJProcess
stochastic volatility with jumps (SVJJ) process
WienerProcess
uni and multivariate Wiener process including subordinated Wiener process
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.
See Also
Finance/Examples/LocalVolatility
Finance Math Apps
Download Help Document