[R] Fwd: sn package - skew t - code for analytical expressions for first 4 moments

Luc Hoegaerts luc.hoegaerts at gmail.com
Tue Oct 14 12:01:02 CEST 2008


Hello

please note that the code at

 https://stat.ethz.ch/pipermail/r-help/2006-August/110892.html

to compute indices of skewness and kurtosis for the skew-t
distribution is not correct.

It has been kindly pointed out that i made some error in this code,
which was a bit too quickly copied from the paper.

The 'sn' package already contains a facility for computing
the cumulants, namely the function st.cumulants which
computes cumulants up to order 4.

With this function, it is immediate to compute skewness and
kurtosis. Examples:

> cum<- st.cumulants(0,2,3,5)
> v <- cum[2]
> skew<- cum[3]/v^1.5
> kurt<- cum[4]/v^2
> print(c(v, skew,kurt))
[1]  3.424  2.127 16.256


I thank Adelchi Azzalini for pointing me out the error,
my apologies to the R list users and thanks to him.

luc



More information about the R-help mailing list