gamlss.dist (version 5.1-6)

momentSK: Sample and theoretical Moment and Centile Skewness and Kurtosis Functions

Description

The functions momentSK(), centileSK(), centileSkew() and centileKurt(), calculate sample statistics related to skewness and kurtosis. The function theoCentileSK() calculates the theoretical centile statistics from a given gamlss.family distribution. The plotCentileSK() plots the theoretical centile skewness and kurtosis against p (see below).

The function checkMomentSK() can be use to check (a) whether the moment skewness and kurtosis of a fitted model are modelled adequantly (the residuals of the model are used). (b) whether a given sample display skewness or kurtosis.

Usage

momentSK(x,  weights=NULL)
centileSK(x, cent = c(1, 25), weights=NULL)
centileSkew(x, cent = 1, weights=NULL)
centileKurt(x, cent = 1, weights=NULL)

theoCentileSK(fam = "NO", p = 0.01, ...) plotCentileSK(fam = "NO", plotting = c("skew", "kurt", "standKurt"), add = FALSE, col = 1, lty = 1, lwd = 1, ylim = NULL, ...) checkMomentSK(x, add = FALSE, bootstrap = TRUE, no.bootstrap = 99, col.bootstrap = "lightblue", pch.bootstrap = 21, asCharacter = TRUE, col.point = "black", pch.point = 4, lwd.point = 2, cex.text = 1.5, col.text = "black", show.legend = TRUE) checkCentileSK(x, type = c("central", "tail"), add = FALSE, bootstrap = TRUE, no.bootstrap = 99, col.bootstrap = "lightblue", pch.bootstrap = 21, asCharacter = TRUE, col.point = "black", pch.point = 4, lwd.point = 2, cex.text = 1.5, col.text = "black", show.legend = TRUE)

Arguments

x

data vector or gamlss model

weights

prior weights for the x

cent

the centile required

type

For centile skewness and kurtosis only whether "central" (default) or "tail")

fam

A gamlss distribution family

plotting

what to plot

add

whether to add the line to the existing plot

col

the colour of the line

lty

the type of the line

lwd

the width of the line

ylim

the y limit of the graph

p

the value determiming the centile skewness or kurtosis

additional arguments pass to theoCentileSK() function i.e. the values of the distribution parameters

bootstrap

whether a plot of the bootstrap skewness and kurtosis measures should be added in the plot

no.bootstrap

the number of boostrap skewness and kurtosis measures

col.bootstrap

the coloue for boostraps

pch.bootstrap

the point type of boostraps

asCharacter

whether to plot the estimated skewness and kurtosis measure as character or as point

col.point

the colour of the skewness and kurtosis measure

pch.point

the point type of the skewness and kurtosis measure

lwd.point

the width of the plotted line

cex.text

the size of the text

col.text

the colour of the text

show.legend

whether to show the legent

Value

Different functions produce different output: The function momentSK() produce:

mom.skew:

sample moment skewness

trans.mom.skew:

sample transformed moment skewness

mom.kurt:

sample moment kurtosis

excess.mom.kurt:

sample excess moment kurtosis

trans.mom.kurt:

sample ransformed moment excess kurtosis

jarque.bera.test:

the value of the Jarque-bera test for testing whether skewness and excess kurtosis are zero or not

The function centileSK() produces:

S0.25:

sample centile central skewness

S0.01:

sample centile tail skewness

trans.S0.25:

sample centile transformed central skewness

trans.S0.01:

sample centile transformed tail skewness

K0.01:

sample centile kurtosis

standK0.01:

standardise centile kurtosis, (K0.01/3.449)

exc.K0.01:

excess centile kurtosis, (K0.01-3.449)

trans.K0.01:

transfored excess centile kurtosis, (exc.K0.01/(1+abs(exc.K0.01))

The function centileSkew() for a given argument p produces:

p:

the value determiming the centile skewness

Sp:

sample centile skewness at p

tSp:

sample transformed centile skewness at p

The function centileKurt() for a given argument p produces:

p

the value determiming the centile kurtosis

Kp

sample centile kurtosis at p

sKp

sample standardise centile kurtosis at p

ex.Kp:

sample excess centile kurtosis at p

teKp:

sample transformed excess centile kurtosis at p

The function theoCentileSK for a given gamlss.family produces:

IR

the interquartile range of the distribution

SIR

the semi interquartile range of the distribution

S_0.25

the central skewness of the distribution

S_0.01:

the tail skewness of the distribution

K_0.01:

the centile kurtosis of the distribution

sK_0.01:

the standardise centile kurtosis of the distribution

Details

Those function calculate sample moment and centile skewness and kurtosis statistics and theoretical centile values for a specific distribution.

References

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in http://www.gamlss.com/.

See Also

gamlss.family

Examples

Run this code
# NOT RUN {
Y <- rSEP3(1000)
momentSK(Y)
centileSK(Y)
centileSkew(Y, cent=20)
centileKurt(Y, cent=30)

theoCentileSK("BCCG", mu=2, sigma=.2, nu=2)
plotCentileSK(fam="BCCG",  mu=2, sigma=.2, nu=2)

checkMomentSK(Y)
checkCentileSK(Y)
#checkCentileSK(Y, type="tail")
# }

Run the code above in your browser using DataLab