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 |
mu |
vector of parameters. Note that if |
sigma |
vector of variance parameters. The default is 1. The variance of the distribution increases as |
lambda |
vector of skewness parameters. Note that |
p , q |
vector of parameters. Smaller values of |
mean.cent |
logical; if TRUE, |
var.adj |
logical or a positive scalar. If |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are
|
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')