Description Usage Arguments Details Value Author(s) References Examples
This method is a compilation of formulas for some (joint) probabilities for the Arithmetic Brownian Motion B_t=B(t) with drift parameter μ and volatility σ and its minimum m_t=m(t) or maximum M_t=M(t).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | calcBMProbability(
Type = c(
"P(M_t >= a)",
"P(M_t <= a)",
"P(m_t <= a)",
"P(m_t >= a)",
"P(M_t >= a, B_t <= z)",
"P(m_t <= a, B_t >= z)",
"P(a <= m_t, M_t <= b)",
"P(M_s >= a, B_t <= z | s < t)",
"P(m_s <= a, B_t >= z | s < t)",
"P(M_s >= a, B_t <= z | s > t)",
"P(m_s <= a, B_t >= z | s > t)"),
a, z=0, t = 1, mu = 0, sigma = 1, s = 0)
|
Type |
Type of probability to be calculated, see details. |
a |
level |
z |
level |
t |
point in time, t > 0 |
mu |
Brownian Motion drift term μ |
sigma |
Brownian Motion volatility σ |
s |
Second point in time, used by some probabilities like |
Let \code{M_t = max(B_t)} and \code{m_t = min(B_t)} for t > 0 be the running maximum/minimum of the Brownian Motion up to time \code{t} respectively.
P(M_t >= a) (P(M_t <= a)) is the probability of the maximum M_t exceeding (staying below) a level \code{a} up to time \code{t}. See Chuang (1996), equation (2.3).
P(m_t <= a) (P(m_t >= a)) is the probability of the minimum m_t to fall below (rise above) a level \code{a} up to time \code{t}.
P(M_t >= a, B_t <= z) is the joint probability of the maximum, exceeding level \code{a}, while the Brownian Motion is below level \code{z} at time \code{t}. See Chuang (1996), equation (2.1), p.82.
P(m_t <= a, B_t >= z)
is the joint probability of the minimum to be below level \code{a}, while the Brownian Motion is above level z
at time t
.
P(M_s >= a, B_t <= z | s < t) See Chuang (1996), equation (2.7), p.84 for the joint probability (M_s,B_t) of the maximum M_s and the Brownian Motion B_t at different times s < t
P(m_s <= a, B_t >= z | s < t) See Chuang (1996), equation (2.7), p.84 for the joint probability of (M_s,B_t) s < t. Changed formula to work for the minimum.
P(M_s >= a, B_t <= z | s > t) See Chuang (1996), equation (2.9), p.85 for the joint probability (M_s,B_t) of the maximum M_s and the Brownian Motion B_t at different times s > t
P(m_s <= a, B_t >= z | s > t) See Chuang (1996), equation (2.9), p.85 for the joint probability (M_s,B_t) of the maximum M_s and the Brownian Motion B_t at different times s > t. Adapted this formula for the minimum (m_s,B_t) by P(M_s >= a, B_t <= z) = P(m_s <= -a, B^{*}_t >= -z).
Some identities:
For s < t:
P(M_s <= a , M_t >= a , B_t <= z ) = P(M_t >= a , B_t <= z) - P(M_s >= a , B_t <= z)
P(M_s >= a, B_t <= z) = P(M_s >= a)- P(M_s >= a, B_t >= z)
P(X <= -x,Y <= -y) = P(-X >= x, -Y >= y) = 1 - P(-X <= x) - P(-Y <= y) + P(-X <= x, - Y <= y)
Changing from maximum M_t of B_t to minimum m^*_t of B^*_t = -B_t:
P(M_t >= z) becomes P(m^*_t <= -z).
The method returns a vector of probabilities, if used with vector inputs.
Stefan Wilhelm wilhelm@financial.com
Chuang (1996). Joint distribution of Brownian motion and its maximum, with a generalization to correlated BM and applications to barrier options Statistics & Probability Letters 28, 81–90
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ################################################################################
#
# Example 1: Maximum M_t of Brownian motion
#
################################################################################
# simulate 1000 discretized paths from Brownian Motion B_t
B <- matrix(NA,1000,101)
for (i in 1:1000) {
B[i,] <- BrownianMotion(S0=100, mu=0.05, sigma=1, T=1, N=100)
}
# get empirical Maximum M_t
M_t <- apply(B, 1, max, na.rm=TRUE)
plot(density(M_t, from=100))
# empirical CDF of M_t
plot(ecdf(M_t))
a <- seq(100, 103, by=0.1)
# P(M_t <= a)
# 1-cdf.M_t(a-100, t=1, mu=0.05, sigma=1)
p <- calcBMProbability(Type = "P(M_t <= a)", a-100, t = 1,
mu = 0.05, sigma = 1)
lines(a, p, col="red")
################################################################################
#
# Example 2: Minimum m_t of Brownian motion
#
################################################################################
# Minimum m_t : Drift ändern von 0.05 auf -0.05
m_t <- apply(B, 1, min, na.rm=TRUE)
a <- seq(97, 100, by=0.1)
# cdf.m_t(a-100, t=1, mu=0.05, sigma=1)
p <- calcBMProbability(Type = "P(m_t <= a)", a-100, t = 1, mu = 0.05, sigma = 1)
plot(ecdf(m_t))
lines(a, p, col="blue")
|
Loading required package: tmvtnorm
Loading required package: mvtnorm
Loading required package: Matrix
Loading required package: stats4
Loading required package: gmm
Loading required package: sandwich
Loading required package: fCertificates
Loading required package: fBasics
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fOptions
Loading required package: fExoticOptions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.