Brownian motion, Brownian bridge, and geometric Brownian motion simulators.
BBridge(x=0, y=0, t0=0, T=1, N=100)
BM(x=0, t0=0, T=1, N=100)
GBM(x=1, r=0, sigma=1, T=1, N=100)
an invisible ts object
initial value of the process at time t0.
terminal value of the process at time T.
initial time.
the interest rate of the GBM.
the volatility of the GBM.
final time.
number of intervals in which to split [t0,T].
Stefano Maria Iacus
These functions return an invisible ts object containing
a trajectory of the process calculated on a grid of N+1
equidistant points between t0 and T; i.e.,
t[i] = t0 + (T-t0)*i/N, i in 0:N. t0=0 for the
geometric Brownian motion.
The function BBridge returns a trajectory of the Brownian bridge
starting at x at time t0 and
ending at y at time T; i.e.,
$$\{B(t), t_0 \leq t \leq T | B(t_0)=x, B(T)=y\}.$$
The function BM returns
a trajectory of the translated
Brownian motion \(B(t), t \geq 0 | B(t_0)=x\);
i.e., \(x+B(t-t_0)\) for t >= t0.
The standard Brownian motion is obtained
choosing x=0 and t0=0 (the default values).
The function GBM returns a trajectory of the geometric Brownian motion
starting at x at time t0=0; i.e., the process
$$S(t) = x \exp\{(r-\sigma^2/2)t + \sigma B(t)\}.$$
plot(BM())
plot(BBridge())
plot(GBM())
Run the code above in your browser using DataLab