dist-sght: Standardized generalized hyperbolic Student-t Distribution In fBasics: Rmetrics - Markets and Basic Statistics

Description

Density, distribution function, quantile function and random generation for the standardized generalized hyperbolic distribution.

Usage

 1 2 3 4 dsght(x, beta = 0.1, delta = 1, mu = 0, nu = 10, log = FALSE) psght(q, beta = 0.1, delta = 1, mu = 0, nu = 10) qsght(p, beta = 0.1, delta = 1, mu = 0, nu = 10) rsght(n, beta = 0.1, delta = 1, mu = 0, nu = 10)

Arguments

 beta, delta, mu numeric values. beta is the skewness parameter in the range (0, alpha); delta is the scale parameter, must be zero or positive; mu is the location parameter, by default 0. These are the parameters in the first parameterization. nu a numeric value, the number of degrees of freedom. Note, alpha takes the limit of abs(beta), and lambda=-nu/2. x, q a numeric vector of quantiles. p a numeric vector of probabilities. n number of observations. log a logical, if TRUE, probabilities p are given as log(p).

Value

All values for the *sght functions are numeric vectors: d* returns the density, p* returns the distribution function, q* returns the quantile function, and r* generates random deviates.

All values have attributes named "param" listing the values of the distributional parameters.

Diethelm Wuertz.

Examples

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ## rsght - set.seed(1953) r = rsght(5000, beta = 0.1, delta = 1, mu = 0, nu = 10) plot(r, type = "l", col = "steelblue", main = "gh: zeta=1 rho=0.5 lambda=1") ## dsght - # Plot empirical density and compare with true density: hist(r, n = 50, probability = TRUE, border = "white", col = "steelblue") x = seq(-5, 5, length = 501) lines(x, dsght(x, beta = 0.1, delta = 1, mu = 0, nu = 10)) ## psght - # Plot df and compare with true df: plot(sort(r), (1:5000/5000), main = "Probability", col = "steelblue") lines(x, psght(x, beta = 0.1, delta = 1, mu = 0, nu = 10)) ## qsght - # Compute Quantiles: round(qsght(psght(seq(-5, 5, 1), beta = 0.1, delta = 1, mu = 0, nu =10), beta = 0.1, delta = 1, mu = 0, nu = 10), 4)

fBasics documentation built on March 13, 2020, 9:09 a.m.