View source: R/lamp-stable-lambda-dist-method.R
dsl | R Documentation |
Implements the stable lambda distribution (SLD) and the quartic stable lambda distribution (QSLD). 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.
dsl(x, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4) dqsl(x, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0) rqsl(n, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0) rsl(n, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4) pqsl(x, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0) psl(x, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4) qqsl(q, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0) qsl(q, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4) kqsl(t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0) ksl(t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4) cfqsl( s, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, method = "a" ) cfsl( s, t = 1, nu0 = 0, theta = 1, convo = 1, beta.a = 0, mu = 0, lambda = 4, method = "a" )
x |
numeric, vector of responses. |
t |
numeric, the time parameter, where the variance is t, default is 1. |
nu0 |
numeric, the location parameter, default is 0. |
theta |
numeric, the scale parameter, default is 1. |
convo |
numeric, the convolution number, default is 1. |
beta.a |
numeric, the skewness parameter, default is 0. This number is annualized by sqrt(t). |
mu |
numeric, the location parameter, default is 0. |
lambda |
numeric, the shape parameter, default is 4. |
n |
numeric, number of observations. |
q |
numeric, vector of quantiles. |
s |
numeric, vector of responses for characteristic function. |
method |
character, method of characteristic function (CF) calculation. Default is "a". Method a uses cfstdlap x dstablecnt. Method b uses dstdlap x cfstablecnt. Method c uses direct integration on PDF up to 50 stdev. They should yield the same result. |
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 stable lambda distribution is the stationary distribution for financial asset returns. It is a product of the stable count distribution and the Lihn-Laplace process. The density function is defined as
P_Λ^(m) (x;t,ν_0,θ,β_a,μ) = integrate_ν_0^∞ 1/ν f_L^(m)((x-μ)/ν; t,β_a sqrt(t)) N_α(ν; ν_0,θ) dν
where
f_L^{(m)}(.) is the Lihn-Laplace distribution and
N_α(.) is the quartic stable count distribution.
t is the time or sampling period,
α is the stability index which is 2/λ,
ν_0 is the floor volatility parameter,
θ is the volatility scale parameter,
β_a is the annualized asymmetric parameter,
μ is the location parameter.
The quartic stable lambda distribution (QSLD) is a specialized distribution with λ=4 aka α=0.5.
The PDF integrand has closed form, and all the moments have closed forms.
Many financial asset returns can be fitted by QSLD precisely up to 4 standard deviations.
Stephen H-T. Lihn
For more detail, see Section 8.2 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.
dstablecnt
for N_α(.),
and dstdlap
for f_L^{(m)}(.).
# generate the quartic pdf for SPX 1-day distribution x <- c(-0.1, 0.1, by=0.001) pdf <- dqsl(x, t=1/250, nu0=6.92/100, theta=1.17/100, convo=2, beta=-1.31)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.