Learn R Programming

ecd (version 0.9.2.4)

dstdlap: Standardized Laplace process and distribution

Description

Implements the standardized Laplace process and distribution. Be aware of the performance concerns: (a) The cumulative density function is implemented by direct integration over the density. (b) The quantile function is implemented by root finding on cumulative density function.

Usage

dstdlap(x, t = 1, convo = 1, beta = 0, mu = 0)

pstdlap(x, t = 1, convo = 1, beta = 0, mu = 0)

qstdlap(q, t = 1, convo = 1, beta = 0, mu = 0)

rstdlap(n, t = 1, convo = 1, beta = 0, mu = 0)

cfstdlap(s, t = 1, convo = 1, beta = 0, mu = 0)

kstdlap(t = 1, convo = 1, beta = 0, mu = 0)

dstdlap_poly(x, t = 1, convo = 1, beta = 0, mu = 0)

Arguments

x

numeric, vector of responses.

t

numeric, the time parameter, of which the variance is t.

convo

numeric, the convolution number, default is 1, which is Laplace without convolution. There is a special provision in rstdlap, where it will simulate the Wiener process if convo=Inf and beta=0.

beta

numeric, skewness parameter according to skewed lambda distribution, default is 0.

mu

numeric, location parameter, default is 0.

q

numeric, vector of quantiles.

n

numeric, number of observations.

s

numeric, vector of responses for characteristic function.

Value

numeric, standard convention is followed: d* returns the density, p* returns the distribution function, q* returns the quantile function, and r* generates random deviates. The following are our extensions: k* returns the first 4 cumulants, skewness, and kurtosis, cf* returns the characteristic function.

Details

The Lihn-Laplace distribution is the stationary distribution of Lihn-Laplace process. The density function is defined as $$ f_{\mathit{L}}^{\left(m\right)}\left(x;t,\beta,\mu\right) \equiv\frac{1}{\sqrt{\pi}\Gamma\left(m\right)\sigma_{m}}\, \left|\frac{x-\mu}{2B_{0}\sigma_{m}}\right|^{m-\frac{1}{2}} K_{m-\frac{1}{2}}\left(\left|\frac{B_{0}(x-\mu)}{\sigma_{m}}\right|\right) e^{\frac{\beta (x-\mu)}{2\sigma_{m}}} $$ where $$ \sigma_{m}\equiv\sqrt{\frac{t}{m\left(2+\beta^{2}\right)}}, \: B_{0}\equiv\sqrt{1+\frac{1}{4}\beta^{2}}. $$ \(K_n(x)\) is the modified Bessel function of the second kind. \(t\) is the time or sampling period, \(\beta\) is the asymmetric parameter, \(\mu\) is the location parameter.

References

For more detail, see Section 5.4 of Stephen Lihn (2017). A Theory of Asset Return and Volatility under Stable Law and Stable Lambda Distribution. SSRN: 3046732, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3046732.

Examples

Run this code
# NOT RUN {
  # generate the pdf at time t=1 for the second convolution and beta = 0.1 for skewness
  x <- c(-10, 10, by=0.1)
  pdf <- dstdlap(x, t=1, convo=2, beta=0.1)

# }

Run the code above in your browser using DataLab