Overview of the Finance Package - Maple Help

Home : Support : Online Help : Mathematics : Packages : Finance

Overview of the Finance Package

 Calling Sequence Finance[command](arguments) command(arguments)

Description

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.

 - calculate the accrued amount of a bond - calculate the basis point sensitivity of future cash flows - return the set of cash flows for a bond or a swap - calculate the clean price of a bond - calculate the convexity of a bond or a set of cash flows - calculate the dirty price of a bond - calculate the duration of a bond or a set of cash flows - construct a fixed-rate coupon on a term structure - construct an in-arrear indexed coupon - calculate the internal rate of return of a set of cash flows or a bond - return the net present value of future cash flows - construct a coupon at par on a term structure - construct a simple cash flow at a given date - construct an up-front indexed coupon on a term structure

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 non-standard calendars.

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 European-style and American-style 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.

 - construct an American-style option with the specified payoff function - construct an American-style swaption - construct a Bermudan-style option with the specified payoff function - construct a Bermudan-style swaption - create new interest rate cap - create new interest rate collar - construct a European-style option with the specified payoff function - construct a European-style swaption - create new fixed-coupon bond - create new floating-rate bond - create new interest rate floor - create new interest rate swap - create new cash-flow swap - create new zero-coupon bond

The following tools are available for working with the above instruments.

 - calculate the price of an interest rate instrument using the Black model - calculate the Charm of a European-style option in the Black-Scholes model - calculate the Color of a European-style option in the Black-Scholes model - calculate the Delta of a European-style option in the Black-Scholes model - calculate the Gamma of a European-style option in the Black-Scholes model - calculate the Lambda of a European-style option in the Black-Scholes model - calculate the price of a European-style option using the Black-Scholes model - calculate the Rho of a European-style option in the Black-Scholes model - calculate the Speed of a European-style option in the Black-Scholes model - calculate the Theta of a European-style option in the Black-Scholes model - calculate the Ultima of a European-style option in the Black-Scholes model - calculate the Vanna of a European-style option in the Black-Scholes model - calculate the Vega of a European-style option in the Black-Scholes model - calculate the Vera of a European-style option in the Black-Scholes model - calculate the Veta of a European-style option in the Black-Scholes model - calculate the Vomma of a European-style option in the Black-Scholes model - calculate the Zomma of a European-style option in the Black-Scholes model - calculate the price of a discount bond option in the given affine short-rate model - calculate the clean price of a bond - calculate the convexity of a bond - calculate the dirty price of a bond - calculate a discount bond price - calculate the duration of a bond - calculate the implied volatility of a European-style option in the Black-Scholes model - construct a volatility term structure - calculate the price of a financial instrument using a binomial or a trinomial tree - calculate the local volatility of a European-style option - create new local volatility term structure - define a new payment schedule - calculate the yield of a bond using its clean price - 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:

 - calculate benchmark rate based on a specified calendar - return a compound factor for the specified date or time - construct a yield curve based on known discount rates - return a discount factor for the specified date or time - calculate equivalent interest rate - return the fair rate of an interest rate swap - return the fair spread of an interest rate swap - compute forward rates based on a given term structure - construct a yield curve based on known forward rates - calculate interest rate implied by a given compound factor - load historic date for a given benchmark rate - compute par rates based on a given term structure - construct a yield curve based on known zero rates - compute zero rates based on a given term structure

Lattice Methods

The Financial Modeling package also provides tools for constructing binomial and trinomial trees.

 - construct a recombining binomial tree data structure - create a recombining binomial tree for a Black-Scholes process - create a recombining trinomial tree for a Black-Scholes process - construct an implied Black-Scholes binomial tree - construct an implied Black-Scholes trinomial tree - construct a trinomial tree for a short-rate process - plot a binomial or trinomial tree - construct a mutable recombining tree data structure

The following commands can be used to inspect/manipulate a tree data structure.

 - return descendants for a node of a binomial or trinomial tree - return the local volatility node of a Black-Scholes binomial or trinomial tree - return probabilities for a node of a binomial or trinomial tree - get the size of a binomial/trinomial tree at the given level - return the value of the underlying for a node of a binomial or trinomial tree - set probabilities for a node of a binomial or trinomial tree - set the value of the underlying for a node of a binomial or trinomial tree

Personal Finance

 -amortization table for a loan -present value of an annuity -present value of a call option -present value of a list of cash flows -convert a stated rate to the effective rate -future value of an amount -present value of a growing annuity -present value of a growing perpetuity -present value of a level coupon bond -present value of a perpetuity -present value of an amount -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.

 - Cox-Ingersoll-Ross interest rate model - Hull-White interest rate model - 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, mean-reverting 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:

 - Black-Scholes process - uni- or multi-variate Brownian motion - constant elasticity of variance (CEV) process - deterministic time-dependent process - a portfolio of stochastic processes which can be dynamically rebalanced - a finite state Markov chain - gamma process - Gaussian process for modeling short-term interest rate - geometric Brownian motion - stochastic volatility process introduced by Heston - general uni- or multi-variate Ito process defined by drift and diffusion - Ito process - jump-diffusion process introduced by Merton - stochastic process with multiple regimes - Ornstein-Uhlenbeck process - Poisson process including the doubly-stochastic Poisson (Cox) process - process that governs a short rate - square-root diffusion - stochastic volatility with jumps (SVJJ) process - uni- and multi-variate Wiener process including subordinated Wiener process

Here are some related commands.

 - compute the diffusion component of an Ito process - compute the drift component of an Ito process - calculate the expected shortfall - compute a Monte Carlo estimate of the specified expression - create new path generator for the specified stochastic process - plot sample path(s) of the specified stochastic process - generate a sample path for the specified stochastic process - generate sample values for the specified stochastic process - estimate value-at-risk for the specified expression