nag_rand_bb_init (g05xac) initializes the Brownian bridge generator
nag_rand_bb (g05xbc). It must be called before any calls to
nag_rand_bb (g05xbc).
Details on the Brownian bridge algorithm and the Brownian bridge process (sometimes also called a non-free Wiener process) can be found in
Section 2.6 in the g05 Chapter Introduction. We briefly recall some notation and definitions.
Fix two times
and let
be any set of time points satisfying
. Let
denote a
-dimensional Wiener sample path at these time points, and let
be any
by
matrix such that
is the desired covariance structure for the Wiener process. Each point
of the sample path is constructed according to the Brownian bridge interpolation algorithm (see
Glasserman (2004) or
Section 2.6 in the g05 Chapter Introduction). We always start at some fixed point
. If we set
where
is any
-dimensional standard Normal random variable, then
will behave like a normal (free) Wiener process. However if we fix the terminal value
, then
will behave like a non-free Wiener process.
Given the start and end points of the process, the order in which successive interpolation times
are chosen is called the
bridge construction order. The construction order is given by the array
times. Further information on construction orders is given in
Section 2.6.2 in the g05 Chapter Introduction. For clarity we consider here the common scenario where the Brownian bridge algorithm is used with quasi-random points. If pseudorandom numbers are used instead, these details can be ignored.
Suppose we require
Wiener sample paths each of dimension
. The main input to the Brownian bridge algorithm is then an array of quasi-random points
where each point
has dimension
or
respectively, depending on whether a free or non-free Wiener process is required. When
nag_rand_bb (g05xbc) is called, the
th sample path for
is constructed as follows: if a non-free Wiener process is required set
equal to the terminal value
, otherwise construct
as
where
is the matrix described in
Section 3.1. The array
times holds the remaining time points
in the order in which the bridge is to be constructed. For each
set
, find
and
and construct the point
as
where
or
respectively depending on whether a free or non-free Wiener process is required. Note that in our discussion
is indexed from
, and so
is interpolated between the nearest (in time) Wiener points which have already been constructed. The function
nag_rand_bb_make_bridge_order (g05xec) can be used to initialize the
times array for several predefined bridge construction orders.
Not applicable.
Not applicable.
The efficient implementation of a Brownian bridge algorithm requires the use of a workspace array called the
working stack. Since previously computed points will be used to interpolate new points, they should be kept close to the hardware processing units so that the data can be accessed quickly. Ideally the whole stack should be held in hardware cache. Different bridge construction orders may require different amounts of working stack. Indeed, a naive bridge algorithm may require a stack of size
or even
, which could be very inefficient when
is large. nag_rand_bb_init (g05xac) performs a detailed analysis of the bridge construction order specified by
times. Heuristics are used to find an execution strategy which requires a small working stack, while still constructing the bridge in the order required.
This example calls nag_rand_bb_init (g05xac),
nag_rand_bb (g05xbc) and
nag_rand_bb_make_bridge_order (g05xec) to generate two sample paths of a three-dimensional free Wiener process. Pseudorandom variates are used to construct the sample paths.
None.