Fractional Brownian motion
In April 2002, I graduated from the Vrije Universiteit
Amsterdam.
My master's thesis is entitled
`Simulation of fractional Brownian motion', and
you can download a revised version
(PDF).
This version has been updated in September 2004, but the
earlier
version is still available.
Code for simulating fractional Brownian motion
I have programmed some algorithms for simulating fractional Brownian
motion.
The resulting C-programs are suited for dynamically loading into
R
(S-Plus
should work as well),
but the routines can be called from any C-program. See the note below
how to use these files with R.
The implementations of some algorithms make use of the C-packages Ranlib
and Meschach, both available via Netlib
(www.netlib.org).
Please feel free to send me suggestions for improving the code.
- The recursive method by Hosking (exact); hosking.h,
hosking.c,
cov.c.
- The circulant method by Davis and Harte (exact);
circulant.h,
circulant.c
, cov.c.
- The Paxson method (approximate);
paxson.h,
paxson.c,
spectrum.h,
spectrum.c.
- The approximate circulant method (approximate); apprcirc.h,
apprcirc.c,
spectrum.h,
spectrum.c.
- Wavelet-based simulation (approximate, theoretically
incorrect; see master's thesis);
wavelet.h,
wavelet.c.
You can also have a look at www.rmetrics.org,
which contains a library (fSeries) with many fBm methods.
Code for computing the covariance matrix of the Conditionalized
Random Midpoint Displacement (RMDmn) method
To compute the covariance matrix of RMD samples
with general truncation parameters, you can use the
file rmdcov.c.
Again, the C-program can be used for dynamically loading into
R. This is done in the file
rmdcov.S.
See the note below on the usage in R.
The code is written in the same style as the
RMDmn algorithm
by Ilkka Norros and Petteri Mannersalo, on which the program is based.
As a consequence, the C-package Meschach
(www.netlib.org) is used.
How to use the files with R
As an example, suppose you would like to use the file
rmdcov.c
in R.
Compile the code in the following way (assuming you have access to the
gcc
compiler):
gcc -I /path/to/meschach -c rmdcov.c
gcc -shared -fPIC -I /path/to/meschach -o rmdcov.so rmdcov.o
/path/to/meschach/meschach.a -lm
Now you are able to load the compiled code dynamically into R, see the
sample file rmdcov.S.
Perl version
Walter Szeliga
has modified the code to help it stand alone, and ported it to Perl.
For more details, see the
corresponding
website at CPAN.
Paper
Some findings of the thesis are described in the paper
`
On spectral simulation of fractional Brownian motion',
coauthored
by Michel Mandjes.
The paper appeared in Probability in the Engineering
and Informational Sciences, 17, p. 417-434, 2003.
Back to my
homepage