ghdist | R Documentation |
Generates a random sample from the G-and-H (GH) distribution with specified parameters.
ghdist(n = 30, A = 0, B = 1, g = 0, h = 0)
n |
An integer specifying the sample size. The default is 30. |
A |
A numeric value specifying the location parameter. The default is 0. |
B |
A numeric value specifying the scale parameter. The default is 1. Must be positive. |
g |
A numeric value specifying the skewness parameter. The default is 0. |
h |
A numeric value specifying the kurtosis parameter. The default is 0. Must be zero or positive. |
The gh distribution is a flexible distribution defined by four parameters: A (location), B (scale), g (skewness), and h (kurtosis). The parameter B must be positive, and h must be zero or positive. This function generates random samples from the gh distribution using these parameters.
The GH distribution was introduced by John W. Tukey in 1977 as a way to model data with varying degrees of skewness and kurtosis. The distribution is defined by transforming standard normal random variables using the g and h parameters to control skewness and kurtosis, respectively.
A numeric vector of length n
containing the generated random samples.
Zeynel Cebeci, A. Firat Ozdemir, Engin Yildiztepe
Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.
rnorm
set.seed(50)
A <- ghdist(100, 50, 2, g=0, h=0)
B <- ghdist(100, 50, 3, g=0.5, h=0.5)
ds <- data.frame(A=A, B=B)
head(ds)
bivarplot(ds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.