Distribution: rugarch distribution functions

Share:

Description

Density, distribution function, quantile function, random generation and fitting from the univariate distributions implemented in the rugarch package, with functions for skewness and excess kurtosis given density skew and shape parameters.

rgarchdist rugarch univariate distributions,
fitdist MLE parameter fit for the rugarch univariate distributions,

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ddist(distribution = "norm", y, mu = 0, sigma = 1, lambda = -0.5, skew = 1, 
shape = 5)
pdist(distribution = "norm", q, mu = 0, sigma = 1, lambda = -0.5, skew = 1, 
shape = 5)
qdist(distribution = "norm", p, mu = 0, sigma = 1, lambda = -0.5, skew = 1, 
shape = 5)
rdist(distribution = "norm", n, mu = 0, sigma = 1, lambda = -0.5, skew = 1, 
shape = 5)
fitdist(distribution = "norm", x, control=list())
dskewness(distribution = "norm", skew = 1, shape = 5, lambda = -0.5)
dkurtosis(distribution = "norm", skew = 1, shape = 5, lambda = -0.5)
distplot(distribution = "snorm", skewbounds = NULL, shapebounds = NULL, 
		n.points = NULL)
skdomain(distribution = "nig", kurt.max = 30, n.points = 25, lambda = 1, 
plot = TRUE, legend = NULL)

Arguments

distribution

The distribution name. Valid choices are “norm”, “snorm”, “std”, “sstd”, “ged”, “sged”, “nig”, “jsu”.

mu, sigma, skew, shape

location, scale and skewness and shape parameters (see details).

lambda

The additional shape parameter for the Generalized Hyperbolic and NIG distributions.

n

The number of observations.

p

A numeric vector of probabilities.

y, q

A numeric vector of quantiles.

x

A univariate dataset (for fitting routine).

control

Control parameters passed to the solnp solver.

skewbounds

The skewed distribution skew bounds for the plot. Leaving it NULL will use a good set of defaults for display purposes.

shapebounds

The shaped distribution shape bounds for the plot. Leaving it NULL will use a good set of defaults for display purposes.

n.points

The number of points between the lower and upper bounds of the skew and shape parameters for which to evaluate the skewness and excess kurtosis. For the skdomain function this determines the kurtosis interval (3-max.kurt) for which to determine (using a solver) the maximum skewness.

kurt.max

The maximum kurtosis for which to determine the bounds for the skewness-kurtosis domain.

plot

Whether to plot the results.

legend

Whether to include a legend with the plot in the skdomain.

Details

For the “nig” and “ghyp” distributions, the shape, skew and lambda are transformed from the ‘zeta-rho’ to the ‘alpha-beta’ parametrization and then scaled by the mean and standard deviation. The fitting routines use the solnp solver and minimize the negative of the log-likelihood. The “dskewness” and “dkurtosis” functions take as inputs the distribution name, skew and shape parameters and return the skewneness and excess kurtosis of the distribution. The functions are not at present vectorized. The distplot provides illustrative plots (or surfaces) of skewness and kurtosis for any of the distributions supported (with the exception of the GH which has 2 shape and 1 skew parameters and hence is impractical to represent).

Value

d* returns the density, p* returns the distribution function, q* returns the quantile function, and r* generates random deviates,
all values are numeric vectors.

fitdist returns a list with the following components:

par

The best set of parameters found.

value

The likelihood values of the optimization (vector whose length represents the number of major iterations).

convergence

An integer code. 0 indicates successful convergence.

lagrange

The lagrange multiplier value at convergence.

h

The hessian at the solution.

xineq0

The value of the inequality constraint multiplier (NULL for the distribution fit problems).

dskewness returns the skewness of the distribution. dkurtosis returns the excess kurtosis of the distribution. skdomain returns the authorized domain of the distribution.

Author(s)

Diethelm Wuertz for the Rmetrics R-port of the “norm”, “snorm”, “std”, “sstd”, “ged”, “sged” and “nig” distrbutions.
Rigby, R. A. and Stasinopoulos D. M for the JSU distribution in the gamlss package.
Alexios Ghalanos for rugarch implementation and higher moment distribution functions.

References

Johnson, N. L. 1954, Systems of frequency curves derived from the first law of Laplace, Trabajos de Estadistica, 5, 283–291.
Barndorff-Nielsen, O. E. 1995, Normal inverse Gaussian processes and the modeling of stock returns, mimeo: Univ.of Aarhus Denmark.
Fernandez C. and Steel, M.F.J. 1998, On Bayesian Modelling of Fat Tails and Skewness, Journal of the American Statistical Association, 359–371.

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.