EBMDistribution: Exponential Brownian Motion Distributions

EBMDistributionR Documentation

Exponential Brownian Motion Distributions

Description

A collection and description of distributions and related functions which are useful in the theory of exponential Brownian motion and Asian option valuation. The functions compute densities and probabilities for the log-Normal distribution, the Gamma distribution, the Reciprocal-Gamma distribution, and the Johnson Type-I distribution. Functions are made available for the compution of moments including the Normal, the log-Normal, the Reciprocal-Gamma, and the Asian-Option Density. In addition a function is given to compute numerically first and second derivatives of a given function.

The functions are:

dlognorm the log-Normal density and derivatives,
plognorm the log-Normal, a synonyme for R's plnorm,
dgam the Gamma density, a synonyme for R's dgamma,
pgam the Gamma probability, a synonyme for R's pgamma,
drgam the Reciprocal-Gamma density,
prgam the Reciprocal-Gamma probability,
djohnson the Johnson Type I density,
pjohnson the Johnson Type I probability,
mnorm the Moments of Normal density,
mlognorm the Moments of log-Normal density,
mrgam the Moments of reciprocal-Gamma density,
masian the Moments of Asian Option density,
derivative the First and second numerical derivative.

Usage

dlognorm(x, meanlog = 0, sdlog = 1, deriv = c(0, 1, 2))
plognorm(q, meanlog = 0, sdlog = 1)
dgam(x, alpha, beta)
pgam(q, alpha, beta, lower.tail = TRUE)
drgam(x, alpha, beta, deriv = c(0, 1, 2))
prgam(q, alpha, beta, lower.tail = TRUE)
djohnson(x, a = 0, b = 1, c = 0, d = 1, deriv = c(0, 1, 2))
pjohnson(q, a = 0, b = 1, c = 0, d = 1)

mnorm(mean = 0, sd = 1)
mlognorm(meanlog = 0, sdlog = 1)
mrgam(alpha = 1/2, beta = 1)
mjohnson(a, b, c, d)
masian(Time = 1, r = 0.045, sigma = 0.30)

derivative(x, y, deriv = c(1, 2))

dEBM(u, t = 1)
pEBM(u, t = 1)
d2EBM(u, t = 1)
dasymEBM(u, t = 1)

Arguments

a, b, c, d

[*johnson] -
the parameters of the Johnson Type I distribution. The default values are a=1, b=1, c=0, and d=1.

alpha, beta

[*gam] -
the parameters of the Gamma distribution.

deriv

an integer value, the degree of differentiation, either 0, 1 or 2.

lower.tail

a logical, if TRUE, the default, then the probabilities are P[X <= x], otherwise, P[X > x].

mean, sd

[*lognorm] -
the parameters of the Normal distribution, the mean and the standard deviation respectively. The default values are mean=0 and sd=1.

meanlog, sdlog

[*lognorm] -
the parameters of the Log Normal distribution, the mean and the standard deviation respectively. The default values are mean=0 and sd=1.

q

a real numeric value or vector.

t

...

Time, r, sigma

the parameters of the Asian Option distribution.

u

...

x

a real numeric value or vector.

y

[derivative] -
a real numeric value or vector, the function values from which to compute the first and second derivative.

Value

The functions d* and p* return the values or numeric vectors of the density and probability of the the corresponding distribution.

The functions m* return a list with three elements, the values of the first four moments rawMoments, the values of the first four central moments centralMoments, and the skewness and kurtosis fisher, also called Fisher parameters.

The function derivative returns a list of two elemtes, $x and $y, where $y($x) is either the first or second derivative of y(x) as selected by the argument deriv.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

## dlognorm -
   # Calculate Log-Normal Density and its Derivaties:
   x = exp(seq(-2.8, 1.2, length = 100))
   y0 = dlognorm(x, deriv = 0)
   y1 = dlognorm(x, deriv = 1)
   y2 = dlognorm(x, deriv = 2) 
   
## derivative -
   # Compare with Numerical Differentiation:
   par(mfrow = c(2, 2))
   xa = exp(seq(-2.5, 1.5, length = 20))
   plot(x, y0, type = "l", main = "Log-Normal Density")
   plot(x, y1, type = "l", main = "1st Derivative")
   z = derivative(xa, dlognorm(xa, deriv = 0), deriv = 1)
   points(z$x, z$y, col = "steelblue")
   plot(x, y2, type = "l", main = "2nd Derivative")
   z = derivative(xa, dlognorm(xa, deriv = 0), deriv = 2)
   points(z$x, z$y, col = "steelblue")

fAsianOptions documentation built on Sept. 9, 2022, 3:08 p.m.