BLACK_SCHOLES Simple Approaches to the Black-Scholes Equation

BLACK_SCHOLES is a MATLAB library which demonstrates several approaches to the valuation of a European call, by Desmond Higham.

Languages:

BLACK_SCHOLES is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

blsprice_test, MATLAB programs which demonstrate the use of the BLSPRICE function, for Black-Scholes option pricing, from the MATLAB Financial Mathematics toolbox.

CNOISE, a MATLAB library which generates samples of noise obeying a 1/f^alpha power law, by Miroslav Stoyanov.

COLORED_NOISE, a MATLAB library which generates samples of noise obeying a 1/f^alpha power law.

ORNSTEIN_UHLENBECK, a MATLAB library which approximates solutions of the Ornstein-Uhlenbeck stochastic differential equation (SDE) using the Euler method and the Euler-Maruyama method.

PCE_BURGERS, a MATLAB program which defines and solves a version of the time-dependent viscous Burgers equation, with uncertain viscosity, using a polynomial chaos expansion in terms of Hermite polynomials, by Gianluca Iaccarino.

PCE_LEGENDRE, a MATLAB program which assembles the system matrix associated with a polynomal chaos expansion of a 2D stochastic PDE, using Legendre polynomials;

PCE_ODE_HERMITE, a MATLAB program which sets up a simple scalar ODE for exponential decay with an uncertain decay rate, using a polynomial chaos expansion in terms of Hermite polynomials.

PINK_NOISE, a MATLAB library which computes a "pink noise" signal obeying a 1/f power law.

SDE, a MATLAB library which illustrates some properties of stochastic differential equations, and the algorithms used to analyze them.

STOCHASTIC_DIFFUSION, MATLAB functions which implement several versions of a stochastic diffusivity coefficient.

STOCHASTIC_GRADIENT_ND_NOISE, a MATLAB program which solves an optimization problem involving a functional over a system with stochastic noise.

Desmond Higham

Reference:

1. Desmond Higham,
Black-Scholes for Scientific Computing Students,
Computing in Science and Engineering,
Volume 6, Number 6, November/December 2004, pages 72-79.

Source Code:

• asset_path.m simulates the behavior of an asset value over time.
• binomial.m uses the binomial method for a European call.
• bsf.m evaluates the Black-Scholes formula for a European call.
• forward.m uses the forward difference method for a European call.
• mc.m uses the Monte Carlo method for a European call.
• r8vec_print_part.m, prints "part" of an R8VEC.
• r8vec_write.m, writes an R8VEC to a file.
• timestamp.m prints the current YMDHMS date as a timestamp.

Last revised on 01 December 2018.