calcGBMProbability: Calculates probabilities for the Geometric Brownian Motion

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
8
9
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.

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.

Value

a vector of probabilities

Author(s)

Stefan Wilhelm wilhelm@financial.com

References

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

See Also

calcBMProbability for probabilities of the standard Brownian Motion

Examples

 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
# 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)

Example output

Loading required package: mvtnorm
Loading required package: tmvtnorm
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


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: fOptions


Rmetrics Package fOptions
Pricing and Evaluating Basic Options
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: fExoticOptions

fExpressCertificates documentation built on May 2, 2019, 11:02 a.m.