Overview

New: 5-30-03

This is a library of Java classes for Monte Carlo simulation of stochastic processes. Special attention is given to applications in Finance.

The emphasis is on the study of random variables which are functionals of the path of some stochastic process. Nonethless the package RandomVariables contains a collection of random variables from basic distributions unaffiliated with any stochastic process.

The classes are designed to replicate the basic mathematical notions of probability theory: random variable, conditioning on information, stochastic process, optional time, sampling a process at an optional time etc. Staying close to mathematical terminology and concepts has several benefits:

Time evolves in multiples t*dt, t=0,1,...,T of a time step dt. Integer time t used in code corresponds to real time t*dt and T is the number of time steps to the time horizon T*dt of the simulation.

Information. It is assumed that the simulation operates in a context providing increasing information about all random phenomena under observation as time increases. Abstract methods take account of this context through the time parameter int t.

Random variables, conditioning. Random variables H are defined through the abstract method getValue(int t) to be interpreted as the next sample from the distribution of H conditioned on all information available at time t. The precise nature of the information and how one conditions on it depends on the context and the implementation is left to the concrete subclasses. There may not be any information or sense of time in which case the paramter t is simply ignored.

In the most important case however the random variable H is a functional (deterministic function) of the path of some stochastic process in which case there is a standard sense of information avialable at time t and how to condition on it (path functional).

Random variables then provide methods to compute numerous statistics (such as means, standard deviations, etc.) and histograms all conditioned on information available at the current time t.

Stochastic Processes are defined through the abstract method timeStep(int t) which advances the path of the process from path[u], u<=t to path[t+1]. A sample of a process X=(X_0,X_1,...,X_T) is a realized path of values X_0=x_0,X_1=x_1,...,X_T=x_T.

The information available at time t is the seqence of values x_0,x_1,...,x_t which have been observed by time t.

A random variable H which is a deterministic function H=f(X_0,X_1,...,X_T) of the path of the process X is called a path functional. Conditioning H at time t on an observed path x_0,x_1,...,x_t means passing to the random variable H=f(x_0,x_1,...,x_t,X_{t+1},...,X_T) and a new sample getValue(t) is generated by branching the existing path at time t (continuing the path from time t to the horizon T) and evaluating H along this branch.

Optional times (stopping times). If a path functional tau=f(X_0,X_1,...,X_T) takes values in the set of times {0,1,2,...,T} it is called a random time. Such a random time is called optional if, for each t, the event [tau=t] is a function of the observed values X_0,...,X_t only.

In other words optionality guarentees that we can decide wether tau=t or not on the basis of information available at time t alone. No prevision into the future development of the process X is necessary to make this decision.

This property is crucial if some urgent action is called for at time tau. At each time t we then have to ask ourselves wether now tau=t, that is wether we have to act now or not.

Sampling a process at an optional time. The value X_tau of the process X at a random time tau is a random variable, the process X sampled at time tau.

Typically a random time tau is defined to be the first time at which some significant event related to the process X takes place. The value X_tau of the process X at time tau is then of obvious interest.

Finance. Markets, trading strategies, the gains from trading (as a random variable), options, Monte Carlo pricing, hedging with various "deltas" (ie. weights of the underlying assets), hedge profit and loss (as a random variable) are defined. Libor Market Model. Currently implemented:

Quasi Monte Carlo package. Halton, Sobol and Niederreiter-Xing generator.

Credits. Let us gratefully acknowledge the use of several other libraries.

GETTING STARTED. Browse the javadoc to get familiar with the programming interface. Example programs illustrating the programming interface can be found in the package Examples. Note also that many classes have a main method which is a simple test program testing the class. These provide additional examples.

Installation. See Installation

Here is a list of known bugs.

Be sure to read and understand the Disclaimer, Lack of Warranty, Unfitness for Purpose

Have fun!

Michael J. Meyer (email)