sgt {sgt}R Documentation

The Skewed Generalized T Distribution

Description

Density, distribution function, quantile function and random generation for the skewed generalized t distribution.

Usage

dsgt(x, mu = 0, sigma = 1, lambda = 0, p = 2, q = Inf, 
mean.cent = TRUE, var.adj = TRUE, log = FALSE)
psgt(quant, mu = 0, sigma = 1, lambda = 0, p = 2, q = Inf, 
mean.cent = TRUE, var.adj = TRUE, lower.tail = TRUE, 
log.p = FALSE)
qsgt(prob, mu = 0, sigma = 1, lambda = 0, p = 2, q = Inf, 
mean.cent = TRUE, var.adj = TRUE, lower.tail = TRUE, 
log.p = FALSE)
rsgt(n, mu = 0, sigma = 1, lambda = 0, p = 2, q = Inf, 
mean.cent = TRUE, var.adj = TRUE)

Arguments

x, quant

vector of quantiles.

prob

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mu

vector of parameters. Note that if mean.cent == TRUE, mu is the mean of the distribution. Otherwise, mu is the mode of the distribution.

sigma

vector of variance parameters. The default is 1. The variance of the distribution increases as sigma increases. Must be strictly positive.

lambda

vector of skewness parameters. Note that -1 < lambda < 1. If lambda < 0, the distribution is skewed to the left. If lambda > 0, the distribution is skewed to the right. If lambda = 0, then the distribution is symmetric.

p, q

vector of parameters. Smaller values of p and q result in larger values for the kurtosis of the distribution. Allowed to be infinite. Note that p > 0, q > 0, otherwise NaNs will be produced.

mean.cent

logical; if TRUE, mu is the mean of the distribution, otherwise mu is the mode of the distribution. May only be used if p*q > 1, otherwise NaNs will be produced.

var.adj

logical or a positive scalar. If TRUE, then sigma is rescaled so that sigma is the variance. If FALSE, then sigma is not rescaled. If var.adj is a positive scalar, then sigma is rescaled by var.adj. May only be used if p*q > 2, otherwise NaNs will be produced.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[X \le x] otherwise, P[X > x].

Details

If mu, sigma, lambda, p, or q are not specified they assume the default values of mu = 0, sigma = 1, lambda = 0, p = 2, and q = Inf. These default values yield a standard normal distribution.

See vignette('sgt') for the probability density function, moments, and various special cases of the skewed generalized t distribution.

Value

dsgt gives the density, psgt gives the distribution function, qsgt gives the quantile function, and rsgt generates random deviates.

The length of the result is determined by n for rsgt, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

sigma <= 0, lambda <= -1, lambda >= 1, p <= 0, and q <= 0 are errors and return NaN. Also, if mean.cent is TRUE but codep*q <= 1, the result is an error and NaNs are produced. Similarly, if var.adj is TRUE but codep*q <= 2, the result is an error and NaNs are produced.

Author(s)

Carter Davis, carterdavis@byu.edu

Source

For psgt, based on

a transformation of the cumulative probability density function that uses the incomplete beta function or incomplete gamma function.

For qsgt, based on

solving for the inverse of the psgt function that uses the inverse of the incomplete beta function or incomplete gamma function.

For rsgt, the algorithm simply uses the qsgt function with probabilities that are uniformly distributed.

References

Hansen, C., McDonald, J. B., and Newey, W. K. (2010) "Instrumental Variables Regression with Flexible Distributions" Journal of Business and Economic Statistics, volume 28, 13-25.

Kerman, S. C., and McDonald, J. B. (2012) "Skewness-Kurtosis Bounds for the Skewed Generalized T and Related Distributions" Statistics and Probability Letters, volume 83, 2129-2134.

Theodossiou, Panayiotis (1998) "Financial Data and the Skewed Generalized T Distribution" Management Science, volume 44, 1650-1661.

See Also

Distributions for other standard distributions which are special cases of the skewed generalized t distribution, including dt for the t distribution, dnorm for the normal distribution, and dunif for the uniform distribution. Other special cases of the skewed generalized t distribution include the generalized t distribution in the gamlss.dist package, the skewed t distribution in the skewt package, the exponential power distribution (also known as the generalized error distribution) in the normalp package, and the Laplace distribution in the rmutil package. Also see beta for the beta function.

Examples

require(graphics)

### This shows how to get a normal distribution
x = seq(-4,6,by=0.05)
plot(x, dnorm(x, mean=1, sd=1.5), type='l')
lines(x, dsgt(x, mu=1, sigma=1.5), col='blue')

### This shows how to get a cauchy distribution
plot(x, dcauchy(x, location=1, scale=1.3), type='l')
lines(x, dsgt(x, mu=1, sigma=1.3, q=1/2, mean.cent=FALSE, var.adj = sqrt(2)), col='blue')

### This shows how to get a Laplace distribution
plot(x, dsgt(x, mu=1.2, sigma=1.8, p=1, var.adj=FALSE), type='l', col='blue')

### This shows how to get a uniform distribution
plot(x, dunif(x, min=1.2, max=2.6), type='l')
lines(x, dsgt(x, mu=1.9, sigma=0.7, p=Inf, var.adj=FALSE), col='blue')


[Package sgt version 2.0 Index]