View source: R/lamp-stable-cnt-distribution-method.R
dstablecnt | R Documentation |
Implements the stable count distribution (based on stabledist package) for stable random walk simulation. Quartic stable distribution is implemented through gamma distribution.
dstablecnt(x, alpha = NULL, nu0 = 0, theta = 1, lambda = NULL) pstablecnt(x, alpha = NULL, nu0 = 0, theta = 1, lambda = NULL) rstablecnt(n, alpha = NULL, nu0 = 0, theta = 1, lambda = NULL) qstablecnt(q, alpha = NULL, nu0 = 0, theta = 1, lambda = NULL) cfstablecnt(s, alpha = NULL, nu0 = 0, theta = 1, lambda = NULL) kstablecnt(alpha = NULL, nu0 = 0, theta = 1, lambda = NULL)
x |
numeric, vector of responses. |
alpha |
numeric, the shape parameter, default is NULL. User must provide either alpha or lambda. |
nu0 |
numeric, the location parameter, default is 0. |
theta |
numeric, the scale parameter, default is 1. |
lambda |
numeric, alternative shape parameter, default is NULL. |
n |
numeric, number of observations. |
q |
numeric, vector of quantiles. |
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 stable count distribution is the conjugate prior of the stable distribution. The density function is defined as
N_α(ν; ν_0, θ) = α/Γ(1/α) * 1/(ν-ν_0) * L_α(1/(ν-ν_0))
where ν>ν_0. α is the stability index,
ν_0 is the location parameter, and θ is the scale parameter.
At α=0.5 aka λ=4, it is called "quartic stable count distribution",
which is a gamma distribution with shape of 3/2. It has the closed form of
N_α(ν; ν_0, θ) = 1/(4 sqrt(π) θ^1.5) (ν-ν_0)^0.5 exp(-(ν-ν_0)/(4θ))
Stephen H-T. Lihn
For more detail, see Section 2.4 and Section 3.3 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. This distribution is also documented formally in Wikipedia: https://en.wikipedia.org/wiki/Stable_count_distribution.
# generate the pdf of the VIX distribution x <- c(0, 100, by=0.1) pdf <- dstablecnt(x, nu0=10.4, theta=1.6, lambda=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.