Learn R Programming

GAS (version 0.3.4.1)

distributions: Distributions of the GAS package

Description

Density, distribution function, quantile function, random generator, moments, scores and information matrix of univariate and multivariate distributions of the GAS package.

Usage

ddist_Uni(y, Theta, Dist, log = FALSE)
pdist_Uni(q, Theta, Dist)
qdist_Uni(p, Theta, Dist)
rdist_Uni(Theta, Dist)
mdist_Uni(Theta, Dist)
Score_Uni(y, Theta, Dist)
IM_Uni(Theta, Dist)

ddist_Multi(y, Theta, Dist, log = FALSE) rdist_Multi(Theta, N, Dist) Score_Multi(y, Theta, Dist)

Value

  1. numeric scalar for: ddist_Uni, pdist_Uni, qdist_Uni, rdist_Uni,

  2. numeric vector for: Score_Uni, Score_Multi and rdist_Multi,

  3. matrix for IM_Uni.

Arguments

y, q

numeric Scalar quantile. For Score_Multi and ddist_Multi, y is a numeric vector.

p

numeric Scalar probability.

Theta

numeric Vector of distribution parameters. The order of the parameters is generally: location, scale, skewness, shape, shape2. When the distribution defined by Dist does not have, say, the shape parameter, this should be simply omitted. See also DistInfo for specific distributions.

Dist

character Label of the conditional distribution, see DistInfo.

log

logical If TRUE, the density value \(p(y)\) is given as \(log(p(y))\). Dy Default log = FALSE.

N

numeric Integer. cross-sectional dimension for the multivariate case.

Author

Leopoldo Catania

Details

The function mdist_Uni returns a vector with four elements: mean, variance, skewness and kurtosis coefficients. The functions Score_Uni and IM_Uni returns the score and the Fisher information matrix for univariate distributions. The function Score_Multi returns the score for multivariate distributions. See DistInfo for the lists of supported distributions. These functions are not vectorized. ddist_Uni and ddist_Multi give the density, pdist_Uni gives the distribution function, qdist_Uni gives the quantile function, and rdist_Uni and rdist_Multi generate random deviates.

Examples

Run this code
# Skew Student-t distribution

# log density
Theta = c("location" = 0, "scales" = 1, "skewness" = 1.2, "shape" = 7)

ddist_Uni(y = 0.5, Theta, "sstd", TRUE)

# probability
pdist_Uni(q = -1.69, Theta, "sstd")

#quantile
qdist_Uni(p = 0.05, Theta, "sstd")

#random generator
rdist_Uni(Theta, "sstd")

#moments
mdist_Uni(Theta, "sstd")

Run the code above in your browser using DataLab