Sie sind auf Seite 1von 14

Kenny MacLean

VIGRE Summer Program


Computing Fractional Brownian Motion

The aim of this project was to study the properties of fractional Brownian motion and to
implement algorithms designed to produce graphs and sample paths of the process. To begin, I
will present some necessary introductory comments on fractional Brownian motion, following
the explanation given by Falconer (3).

Introduction: Let us recall the definition of fractional Brownian motion. For 0  h  1, we


define Xh(t) to be a fractional Brownian motion, of index h, if:
• Xh(t) is continuous and Xh(0) = 0 a.s.
• For any d  0, the increment Xh(t + d) – Xh(t) is normally distributed with mean zero and
variance d2h, that is,
y
1
P(Xh(t + d) – Xh(t) ≤ y) = ∫ exp( −u
2
/( 2d 2 h )) du
2πd 2 h −∞

It is easy to show that if Xh,1, Xh,2, and Xh,3 are independent fractional Brownian motions of index
h, and we define the vector X = (Xh,1,Xh,2,Xh,3), than if we choose any orthonormal set of axes in
R3 and let Y = (Yh,1,Yh,2,Yh,3) be the vector X represented in this new coordinate system, than Yh,1,
Yh,2, and Yh,3 are independent fractional Brownian motions of index h. Given this symmetry, it is
natural to plot sample paths of fractional Brownian motion, for which the coordinates are given
by independent fractional Brownian motions of index h, in two and three dimensions.
It is a fairly straightforward exercise calculate the covariance of Xh(t) and Xh(t + d) –
Xh(t). We write (Xh(t + d) – Xh(t))(Xh(t)) as (1/2)((Xh(t + d))2 – (Xh(t))2 – (Xh(t + d) – Xh(t))2), so
that cov(Xh(t),Xh(t + d) – Xh(t)) = E(Xh(t)(Xh(t + d) – Xh(t))) – E(Xh(t))E(Xh(t + d) – Xh(t)) E(Xh(t)
(Xh(t + d) – Xh(t)) = (1/2)((t + d)2h – t2h – d2h). As this function is equal to zero only when h = ½
(the index corresponding to standard Brownian motion), we see that Xh(t) and Xh(t + d) – Xh(t)
are not independent random variables. Thus, with independent increments present only for h =
½, the simple Brownian case, simple algorithms designed to graph Brownian motion, such as the
midpoint displacement method, cannot be extended to graph fractional Brownian motion for h ≠
½. Computing general Fractional Brownian motion requires a more sophisticated approach.

Stochastic Integral Representation: A natural way to make a first attempt at graphing


fractional Brownian motion is to start with an alternative definition of the process. I will now
explain this idea, following the comments given by Coeurjolly (2). Fractional Brownian motion
can be defined as a stochastic integral:
+∞ 1 1
h− h−
Xh(t) = C(h) ∫ ((t − u )
−∞
+
2
− ( −u ) + )dB (u )
2

Where C(h) is a constant depending only on h, and B(x) is standard Brownian motion. It is a
simple exercise to show that this definition and the one given above are equivalent. One can
compute Brownian motion on an interval [-M, 1], for some large M, at points equally spaced at
1/N away from one another, and then find the change ∆B ( x ) ≈ dB(x) between each of these
points. The stochastic integral can be approximated by the sum:
1 1
h− h−
Xh(t) ≈ C ( h) ∑((t − x)
x =i / N
+
2
− ( −x ) + ) ∆B ( x )
2
where we sum over x = i/N, -M ≤

x ≤ t.
This method is slow and inaccurate. First, it is very difficult to approximate fractional Brownian
motion for indices h  ½, simply because in this case (t –u)h – ½ tends to infinity as u tend to t,
making the stochastic integral very difficult to approximate using a summation. Even for indices
h  ½, the method still relies on an approximation of the stochastic integral, and is therefore
imprecise. In addition, an approximation of this integral is extremely slow. For each of the N
points t, the summation alone requires an order of NM computations. Thus the method requires
an order of at least N2M computations.

Results: I have implemented this algorithm using Matlab. Some of the code is given in figure 1
and a sample graph produced using this method is given in figure 2. I was able to implement this
method only for the indices h  ½, owing to the difficulties mentioned above.

Firgure 1:
function f = veryslowfbm(x,n,h,C)
%This function fractionally integrates brownian motion. It
approximates fbm, index h. at points equally spaced at 2^(-x)
int the interval [0,1], integrating back from -n + 1
%The pastebm(x,n) function in given in a different function
file. It produces a brownian motion on the interval [-n,1]
A = pastebm(x,n);
%We now create a vector of increments of brownian motion, Inc.
Inc = zeros(1,(2^x)*n);
for m = 1 : (2^x)*n
Inc(m) = A(m + 1) - A(m);
end
%Here we just create a vector whose entries are the points
spaced at 2^-x on the interval [-n,1].
Y = zeros(1,(2^x)*n);
for m = 1 : 2^x
Y(m + (2^x)*(n - 1)) = Y(m - 1 + (2^x)*(n - 1)) + (2^(-x));
end
for m = 1 : (2^x)*(n - 1) - 1
Y(-m + (2^x)*(n - 1)) = Y(1 - m + (2^x)*(n - 1)) - (2^(-x));
end
Slow = zeros(1,(2^x) + 1);
%now, for each value multiple of 2^-x in the interval [0,1], we
integrate, and store the result in the "Slow" vector.
for m = 1 : (2^x) + 1
t = (m - 1)*(2^(-x));
integrand = zeros(1,(2^x)*n);
for k = 1 : (2^x)*(n - 1) - 1
integrand(k) = (abs(t - Y(k))^(h - (1/2))) - (abs(Y(k))^(h
- (1/2)));
end
for k = (2^x)*(n - 1) : (2^x)*(n - 1) + m - 1
integrand(k) = (t - Y(k))^(h - (1/2));
end
L = integrand.*Inc;
Slow(m) = sum(L,2)/C;
end
f = Slow
R = zeros(1,(2^x) + 1);
for k = 2 : 2^x + 1
R(k) = R(k - 1) + (2^(-x));
end
plot(R,Slow)

Firgure 2: Fractional Brownian Motion, index = .65, Generated by Integration (plotted at 2 9 points, integrating from -100)
0.4

0.2

-0.2
X(t)

-0.4

-0.6

-0.8

-1

-1.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t

Graphical approximations of fractional Brownian motion can be checked using the fact t2h =
var(Xh(t)) = E((Xh(t))2) since E(Xh(t)) = 0. Thus, by the strong law of large numbers, it follows
that:
N
(∑ ( X hi (t )) 2 ) / N → t 2 h as N → ∞ , where the X hi are independent fractional Brownian
1

motions of index h. Thus one can write a check program, in which a large number of N of
independent fractional Brownian motions, each of index h, are run, then squared at each point t,
divided by N and summed. The resulting graph is then compared to the graph of t2h. I have
implemented such a check program for the fractional integration method and my integration
program satisfied this testing method. However, this method provides only limited accuracy and
is too slow to produce pictures of a satisfactory resolution.
Instead of continuing in an investigation of fast algorithms motivated by the stochastic
integral definition of fractional Brownian motion, I turned to an alternative set of algorithms.
These methods approach the problem from a different perspective, and are particularly accessible
because they do not require an advanced understanding of stochastic calculus or wavelets as do
many of the algorithms stemming from the stochastic integral definition. I will now explicate the
basic idea behind these algorithms, following the explanation given by Coeurjolly (2).
Finding Intervals in Fractional Brownian motion: Suppose we divide the interval [0,N] into
N intervals Ij = [j, j+1], where j = 0, 2, . . . ,N - 1. We then compute the covariance of
increments in Xh(t) over a pair of these intervals, Ij, Im, j ≤ m . Using a similar trick to the one
used above, we find:
cov(Xh(j + 1) – Xh(j),Xh(m + 1) – Xh(m))
= (1/2)((m – j + 1)2h + (m – j – 1)2h – 2(m – j)2h)
We then construct a matrix C each of whose entries Cjm is equal to the covariance of increments
of Xh(t) over the intervals Ij and Im. To find the distributions of the N increments in Xh(t), we
must find N normal distributions, each with mean = 0 and variance = 1, with the covariance
between the ith and jth distributions given by the matrix element Cjm. There is only one such set
of N distributions (I will not prove this here). Now, suppose we could find a real matrix L such
that C = LLT. Then, consider the vector Ln, where n is a column of N independent normal
distributions, each with mean = 0, and variance = 1. Let us calculated the covariance of the ith
and jth elements of Ln.
N −1 N −1 N −1 N −1
cov( ∑Lik n k , ∑L jk n k ) = E( ∑Lik L jk n k ) = ∑L LTkj = Cij, since the nk are
2
ik
k =0 k =0 k =0 k =0
independent.
Thus, if we can find this matrix L, we can pick increments in fractional Brownian motion over
each of the N intervals off the distributions given by Ln, and then simply add them up. We can
then use a scaling property of fractional Brownian motion: If Xh(t) is a fractional Brownian
motion of index h, then so is (N-h)Xh(Nt) (This is easy to check). Thus, we just divide by Nh to
get fractional Brownian motion on the interval [0,1]. I have implemented one algorithm
designed to compute L. Graphs I generated using this algorithm are shown in figure 3 and figure
4.
Figure 3: Graph of fractional Brownian motion, index = .3, generated by Levinson's algorithm at 800 points.
1.5

0.5
X(t)

-0.5

-1

-1.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t
Figure 4: Graph of fractional Brownian motion, index = .7, generated by Levinson's algorithm at 800 points.
0.2

0.1

-0.1
X(t)

-0.2

-0.3

-0.4

-0.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t

I will not give an explanation of this algorithm here. One can be found in Coeurjolly (2). It
suffices to say that once the matrix L has been calculated, to carry out the matrix multiplication
Ln, an order of N2 computations is necessary. The Wood-Chan method, which I will now come
to, is both easier to understand and less computationally demanding, requiring only a basic
understanding of linear algebra and probability, and only an order of NlnN computations.

The Wood-Chang Method: I will now sketch my understanding of this algorithm, again
following the explanation given by Coeurjolly (2). To investigate the Wood-Chan method, one
first imagines extending the matrix C to a new matrix A. First, note that Cjm is a function of the
absolute value of m – j only. Let p = N – 1, and let M = 2p. Now, the matrix A is constructed as
follows. We take the first row of C, C1 = [c0,c1,. . . . .,cp], and extend it to be a M dimensional
row A0 = [c0,c1, . . . . ,cp,cp – 1,cp – 2, . . . , c1]. To produce Aj from Aj – 1, one places the last element
of Aj-1 as the 0th element of Aj. Then, for the mth element of Aj, one places the (m – 1)th element
of Aj – 1. In other words, if Aj - 1 = [a0,a1,. . . ,a2p], then we set Aj = [a2p,a0,a1,. . . ,a2p-1]. We
produce rows in this manner until A until it is a square matrix, M by M. It is easy to check that C
is found if we take the first N columns of A, and then the first N rows of those columns: C is the
N by N upper left hand block of A. Clearly if we can find a column of M normal variables each
with mean = 0, with the covariance of the ith and jth elements of the column given by Aij, then
the covariance of the mth and nth variables is given by Cmn if m and n are less than N. Therefore
the first N of these variables give us increments in fractional Brownian motion. Now it is a
straightforward exercise to show that A is symmetric. Since its elements are real, we have A =
At, and therefore we can write A = Qt DQ, where Q is the unitary matrix whose columns are the
eigenvectors of A, and D is the diagonal matrix whose entries are the eigenvalues of A. It
happens that it is very easy to write down the eigenvectors of A and their corresponding
eigenvalues. For n = 0,1,2,. . . . .,2p – 1, the nth eigenvector qn of A and its corresponding
eigenvalue dn are given as follows:
M −1 / 2 exp(( 2πin (0)) / M )
M −1 / 2 exp(( 2πin (1)) / M ) M −1
qn = .
. dn = ∑A
k =0
0k exp( 2πikn / M )
.
.

M −1 / 2 exp(( 2πi ( M −1)) / M )


This is easy to show. It is obvious that the 0th element of Aqn , (Aqn)0, is given by
d n exp(( 2πin (0)) / M ) = d n . Now, suppose that the jth element Aqn , (Aqn)j, is given by
d n exp(( 2πin ( j )) / M ) . Then we have (Aqn)j+1 =
M −1 M −2

∑ A( j +1),k M −1 / 2 exp( 2πink / M ) = A j ,( M −1) M −1 / 2 exp( 2πin (0) / M ) + ∑ A jk M −1 / 2 exp( 2πin(k + 1) / M ) =


k =0 k =0

= exp( 2πin / M ) (Aqn)j = exp( 2πin ( j +1) / M )( d n ) . Therefore, by induction, these are the
correct eigenvectors and corresponding eigenvalues. Now, we note that the vector d whose
entries are the eigenvalues of A is essentially just a discrete Fourier transform of A0, and thus
may be computed using the fast Fourier transform, requiring an order of MlnM computations.
Now, let us denote by D1/2 the diagonal matrix whose entries are equal to the square roots of the
eigenvalues of A. We note that (Q t D1 / 2 Q)( Q t D1 / 2 Q) = Q t DQ = A . Now, it turns out that J =
QtD1/2Q is both symmetric and real (I will not prove this here). It follows that A = JJT, and
therefore that if n is a vector of M independent normal variables each with mean = 0 and
variance = 1, than QtD1/2Qn is a real vector of M normal variables with mean = 0 and covariance
structure given by A. To compute D1/2 costs us and order of MlnM computations. To carry out
the matrix multiplication Qn would cost us an order of M2 computations, so we need a faster way
to produce this vector. Now, the jth element of Qn is simply equal to
M −1 M −1 M −1

∑M −1 / 2 exp( 2πijl / M )nl = ∑M −1 / 2 cos( 2πjl / M )nl + i ∑M −1 / 2 sin( 2πjl / M )nl


l =0 l =0 l =0
If j is equal to either zero or M/2, than this sum is simply equal to gj, a normal variable with
−1 / 2
mean =0 and variance = 1. If j is not equal to zero or M/2, this sum is equal to 2 (a j + ib j ) ,
where aj and bj are two normal variables each with mean = 0 and variance = 1. (using the fact
M −1 M −1
that for such j, ∑ M −1 cos 2 (2πjl / M ) = ∑ M −1 sin 2 (2πjl / M ) = 1 / 2 ). Now, note that the
l =0 l =0
M −1
simple geometric sum ∑M
l =0
−1
exp ( 2πinl / M ),0 ≤ n ≤ M is equal to one if n = M or n = 0, and

is equal to 0 otherwise. From this it follows that E((Qn)j,(Qn)k) =


M −1

∑M
l =0
−1
exp( 2πi ( j + k )l / M ) is equal to 1 if j + k is equal to zero or M and is equal to zero

otherwise. It follows that E( g 0 g M / 2 ) = 0, E ( g 0 (a j + ib j )) = 0, E ( g M / 2 (a j + ib j )) = 0, and that 0


= E ((1 / 2)( a j + ib j )( a j + ib j )) = iE ( a j b j ) , for any j not equal to zero or M/2. The first three
expressions imply that we may produce two independent normal variables x and y, each with
mean = 0 and variance = 1, and simply set (Qn)0 = x and (Qn)M/2 = y. The last expression tells us
that for each j not equal to zero or M/2, aj and bj are independent. Now, if j and k are not equal to
M −1
zero or M/2, we have that 2
−1 / 2
(a j − ib j ) = (Qn)j* = ∑M
l =0
−1 / 2
exp( −2πilj / M ) . We then
M −1
have that E((Qn)k,(Qn)j*) equal to ∑M exp( 2πil (k − j ) / M )
l =0
which is always equal to zero if
k ≠ j , and k and j are between 1 and M – 1. It follows this and previous statements that if k + j
is not equal to M, we have that E ((1 / 2)( a k + ib k )( a j − ib j )) = 0, E ((1 / 2)( a k + bk )( a j + ib j )) = 0
, from which it follows that ak, aj, bk, and bj are all independent. If, on the other hand, k + j = M,
we have that E ((1 / 2)( a k + ib k )( a j − ib j )) = 0 , but that E ((1 / 2)( a k + ib k )( a j + ib j )) =1 , from
which it follows that E(akbj) = E(bkaj) = 0 but that E(akaj) = 1 and E(bkbj) = -1, in other words
that ak = aj = xj and bk = -bj = yj, where xj and yj are two independent normal variables with mean
= 0 and variance = 1. This implies that to generate the row Qn, all we have to do is pick two
independent normal variables each with mean = 0 and variance =1, and set (Qn)0= x and (Qn)M/2
= y. Then, for j = 1,2, . . . .,(M/2) – 1, we pick two independent normal variables, xj and yj, each
with mean = 0 and variance = 1, and set (Qn)j = 2-1/2(xj + iyj) and (Qn)M-j = 2-1/2(xj - iyj). The total
computations required for this procedure is of order M. Now that we have Qn and D1/2, we
proceed to calculate QtD1/2Qn. We note that (QtD1/2Qn)j is equal to
M −1

∑M
l =0
−1 / 2
exp( −2πil j / M )d '1 / 2 (Qn)l. Thus our vector QtD1/2Qn is simply computed using

another fast Fourier transform, with computational cost of order MlnM. The first N elements of
this vector give us our increments in fractional Brownian motion.

Results: I have implemented the Wood-Chan algorithm, and have given the Matlab code in
figure 5. I have produced graphs with a variety of indices using this algorithm, which are shown
in figures 6 -10. I have also produced two and three dimensional sample paths of fractional
Brownian motion for various indices, which are given in figures 11 -16. Each of these pictures
uses fractional Brownian motions computed at 2^14 points between zero and one, except for the
sample path for index = .38 in three dimensions, which I constructed using fractional Brownian
motions computed at 2^15 points between zero and one. I found this method fast enough to
produce graphs with a great amount of detail.

Figure 5
function f = fasterfbm(N,h)
% this runs the wood-chang algorithm, with fbm-index h and the
unit interval subdivided into intervals of length 2^(-N)
C = zeros(1,2^(N + 1));
%First we must compute the entries of the extended matrix.
There are only 2^(N + 1) of them so we will store them in C.
%The autocov function is stored in a different function file.
autocov(a,b,c,d) gives the autocovariance of fractional
%Brownian motion, index c, of the intervals [a/d,(a + 1)/d] and
[b/d,(b + 1)/d].
for k = 1 : 2^N
C(k) = autocov((k - 1),0,h,1);
end
for k = (2^N) + 1: 2^(N + 1)
C(k) = autocov((2^(N + 1)) - (k - 1),0,h,1);
end
%We use the fast fourier transform to quickly calculate the
eigen values of the extended matrix, which we store in the
%row A.
A = fft(C);
%We us a quick algorithm to compute the column Qn, where n is
the vector of n standard gaussian variables.
W(1) = randn(1);
W((2^N) + 1) = randn(1);
for j = 2 : 2^N
X(j) = randn(1);
Y(j) = randn(1);
W(j) = (2^(-.5))*(X(j) + Y(j)*i);
W(2^(N + 1) - j + 2) = (2^(-.5))*(X(j) - Y(j)*i);
end
Z = zeros(1,2^N);
%we multiply this row by the square root of the diagonal matrix
of eigenvalues.
L = zeros(1,2^(N + 1));
for n = 1 : 2^(N + 1)
L(n) = (((A(n))^(1/2))*(W(n)))/((2^(N + 1))^(1/2));
end
%We again use the fast fourier transform to multiply this column
by Q* to get increments in fbm.
Z = fft(L)
%We simply add up the increments
Figure 6: Graph of Fractional Brownian motion, index = .17
1

0.5

-0.5
X(t)

-1

-1.5

-2

-2.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t
Figure 7: Graph of fractional Brownian motion, index = .25
2

1.5

1
X(t)

0.5

-0.5

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t

Figure 8: Graph of fractional Brownian motion, index = .35


0.5

-0.5
X(t)

-1

-1.5

-2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t

Figure 9: Graph of fractional Brownian motion, index = .7


0.2

0.1

-0.1
X(t)

-0.2

-0.3

-0.4

-0.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t
Figure 10: Graph of fractional Brownian motion, index = .85
0.7

0.6

0.5

0.4

0.3
X(t)

0.2

0.1

-0.1

-0.2

-0.3
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t

Figure 11: Sample path of fractional Brownian motion, index = .6, in two dimensions

-0.2

-0.4

-0.6

-0.8

-1

-1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2

Figure 12: Sample path of fractional Brownian motion, index = .75, in two dimensions

-0.2

-0.4

-0.6

-0.8

-1

-1.2

-0.5 0 0.5 1 1.5


Figure 13: Sample path of fractional Brownian motion, index = .9, in two dimensions

0.2

0.15

0.1

0.05

-0.05

-0.1

-0.4 -0.35 -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 0.05

Figure 14: Sample path of fractional Brownian motion, index = .38, in three dimensions

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1

-1.2

0.5

0
0.5
-0.5 0

-1 -0.5
Figure 15: Sample path of fractiona Brownian motion, index = .68, in three dimensions

0.1

-0.1

-0.2

-0.3

-0.4

0.8

0.6 0
-0.2
0.4
-0.4
0.2 -0.6

0 -0.8
-1
-0.2

Figure 16: Sample path of fractional Brownian motion, index = .85, in three dimensions

1.4

1.2

0.8

0.6

0.4

0.2

0
0
-0.2
-0.4
-0.6
1
-0.8
-1
0.5
-1.2
-1.4
0

Afterward and Acknowledgements: I was pleased with my results in this project. I had never
had any programming experience before participating in this seminar, and I felt that I learned a
great deal about fractional Brownian motion, basic programming, and the large amount of
background material required to approach this subject. I would like to thank everyone who
helped me with this project. In particular, I would like to thank Nam-Gyu Kang and Anna
Mazzucato, for helping me throughout this seminar. Nam-Gyu Kang found for me most of the
references I found useful, and also provided explanation that I needed not given in any of these
sources, such as the testing method I have mentioned above. Both of these individuals were
extremely helpful in helping me to obtain an understanding of fractional Brownian motion and
some of the computational methods used for its simulation.

Sources

(1) Abry, Patrice and Sellan, Fabrice. (1996) The Wavelet-Based Synthesis for Fractional
Brownian Motion Proposed by F. Sellan and Y. Meyer: Remarks and Fast
Implementation, Applied and Computational Harmonic Analysis 3, 377-383.

(2) Coeurjolly, Jean-Francis. (2000) Simulation and Identification of the Fractional Brownian
Motion: A Bibliographical and Comparative Study. Preprint.

(3) Falconer, Kenneth. (1990) Fractal Geometry, John Wiley & Sons, Chichester.

(4) Samorodnitsky, Gennady and Taqqu, Murad S. (1994) Stable Non-Gaussian Random
Processes, Chapman & Hall, New York.

Das könnte Ihnen auch gefallen