View source: R/lamp-stdlap-distribution-method.R
dstdlap | R Documentation |
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.
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)
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 |
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. |
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.
The Lihn-Laplace distribution is the stationary distribution of Lihn-Laplace process. The density function is defined as
f_L^(m)(x;t,β,μ) = 1/(sqrt(π)Γ(m)σ_m) |(x-μ)/2B0 σ_m|^(m-1/2) K_(m-1/2)(|B0 (x-μ)/σ_m|) exp(β (x-μ)/2σ_m)
where
σ_m = sqrt(t/m/(2+β^2)), B0 = sqrt(1+β^2/4).
K_n(x) is the modified Bessel function of the second kind. t is the time or sampling period, β is the asymmetric parameter, μ is the location parameter.
Stephen H-T. Lihn
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.