BrownExcursion1D.svg
Size of this PNG preview of this SVG file:
720 × 540 pixels
.
Other resolutions:
320 × 240 pixels
|
640 × 480 pixels
|
1,024 × 768 pixels
|
1,280 × 960 pixels
|
2,560 × 1,920 pixels
.
Summary
Description BrownExcursion1D.svg |
English:
A realization of Brown excursion process.
|
Date | |
Source | Own work |
Author | Shiyu Ji |
Python/Matplotlib Code
# A realization of 1D Brownian Excursion process time step dt = .0001
import matplotlib.pyplot as pl
import numpy as np
t0 = 0.0
dt = 0.0001
t_final = 1.0
T = np.arange(t0, t_final, dt)
ax = pl.figure().add_subplot(111)
ax.set_xlabel('t')
ax.set_ylabel('X')
np.random.seed(3)
while True:
B = [0.0]
for _ in range(len(T)):
old_value = B[-1]
new_value = old_value + np.random.normal(0, dt)
B.append(new_value)
W1 = B[-1]
for i in range(len(B)):
B[i] = B[i] - dt*i*W1
if min(B) > -1e-14:
break
for i in range(1,len(B)):
ax.plot([dt*i, dt*(i-1)], [B[i], B[i-1]], 'b-', linewidth=0.5)
pl.show()
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the
Creative Commons
Attribution-Share Alike 4.0 International
license.
-
You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
-
Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.