dstdlap: Standardized Laplace process and distribution

View source: R/lamp-stdlap-distribution-method.R

dstdlapR Documentation

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_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.

Author(s)

Stephen H-T. Lihn

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

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


ecd documentation built on May 10, 2022, 1:07 a.m.