Learn R Programming

fExpressCertificates (version 1.3)

calcGBMProbability: Calculates probabilities for the Geometric Brownian Motion

Description

This method is a compilation of formulas for some (joint) probabilities for the Geometric Brownian Motion \(S_t=S(t)\) with drift parameter \(\mu\) and volatility \(\sigma\) and its minimum \(m_t=m(t)=\min_{0 \le \tau \le t}{S(\tau)}\) and its maximum \(M_t=M(t)=\max_{0 \le \tau \le t}{S(\tau)}\).

Usage

calculateProbabilityGeometricBrownianMotion(
  Type = 
  c("P(S_t <= x)",="" "p(s_t="">= X)",
    "P(S_t >= X, m_t >= B)",
    "P(M_t <= b)",="" "p(m_t="">= B)",
    "P(m_t <= b)",="" "p(m_t="">= B)"), S0 = 100, X, B, t = 1, mu = 0, sigma = 1)

Arguments

Type

Type of probability to be calculated, see details.

S0

Start price

X

strike level

B

barrier level

t

time

mu

drift term

sigma

volatility in % p.a.

Value

a vector of probabilities

Details

Let \(M_t = \max(S_t)\) and \(m_t = \min(S_t)\) for \(t > 0\) be the running maximum/minimum of the Geometric Brownian Motion \(S\) up to time \(t\) respectively.

  • \(P(S_t \le X)\) is the probability of the process being below \(X\) at time \(t\). Possible Application: shortfall risk of a plain-vanilla call option at maturity

  • \(P(M_t \ge B)\) is the probability of the maximum exceeding a barrier level \(B\).

  • \(P(M_t \le B)\) is the probability of the maximum staying below a barrier level \(B\) up to time \(t\).

  • \(P(m_t \le B)\) is the probability of the minimum to fall below a barrier level \(B\).

  • \(P(m_t \ge B)\) is the probability of the minimum to stay above barrier level \(B\).

References

Poulsen, R. (2004), Exotic Options: Proofs Without Formulas, Working Paper p.7

See Also

calcBMProbability for probabilities of the standard Brownian Motion

Examples

Run this code
# NOT RUN {
# Simulate paths for Geometric Brownian Motion and compute barrier probabilities
N=400
S <- matrix(NA,1000,N+1)
for (i in 1:1000) {
  S[i,] <- GBM(S0=100, mu=0.05, sigma=1, T=1, N=N)
}

# a) Maximum M_t
M_t <- apply(S, 1, max, na.rm=TRUE)

S0 <- 100
B  <- seq(100, 1000, by=1)

p1 <- calcGBMProbability(Type="P(M_t <= B)", S0=S0, B=B, t=1, mu=0.05, sigma=1)

# or via arithmetic Brownian Motion and drift mu - sigma^2/2
p2 <- calcBMProbability(Type="P(M_t <= a)", a=log(B/S0), t=1, mu=0.05-1/2, sigma=1)

plot(ecdf(M_t))
lines(B, p1, col="red", lwd=2)
lines(B, p2, col="green")

# b) Minimum m_t
m_t <- apply(S, 1, min, na.rm=TRUE)

B  <- seq(0, 100, by=1)
p3 <- calcGBMProbability(Type="P(m_t <= B)", S0=S0, B=B, t=1, mu=0.05, sigma=1)
p4 <- calcBMProbability(Type="P(m_t <= a)", a=log(B/S0), t=1, mu=0.05-1/2, sigma=1)

plot(ecdf(m_t))
lines(B, p3, col="red", lwd=2)
lines(B, p4, col="green", lty=2)
# }

Run the code above in your browser using DataLab