Description Usage Arguments Details Value Author(s) References See Also Examples
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(τ)}.
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)
|
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. |
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.
\code{P(S_t <= X)} is the probability of the process being below \code{X} at time \code{t}.
Possible Application: shortfall risk of a plain-vanilla call option at maturity
\code{P(M_t >= B)} is the probability of the maximum exceeding a barrier level \code{B}.
\code{P(M_t <= B)} is the probability of the maximum staying below a barrier level \code{B} up to time \code{t}.
\code{P(m_t <= B)} is the probability of the minimum to fall below a barrier level \code{B}.
\code{P(m_t >= B)} is the probability of the minimum to stay above barrier level \code{B}.
a vector of probabilities
Stefan Wilhelm wilhelm@financial.com
Poulsen, R. (2004), Exotic Options: Proofs Without Formulas, Working Paper p.7
calcBMProbability
for probabilities of the standard Brownian Motion
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)
|
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.