moments {fastmatrix} | R Documentation |
Central moments
Description
It calculates up to fourth central moments (or moments about the mean), and the skewness and kurtosis coefficients using an online algorithm.
Usage
moments(x)
Arguments
x |
a numeric vector containing the sample observations. |
Details
The -th central moment is defined as
In particular, the second central moment is the variance of the sample. The sample skewness and kurtosis are defined, respectively, as
Value
A list containing second
, third
and fourth
central moments,
and skewness
and kurtosis
coefficients.
References
Spicer, C.C. (1972). Algorithm AS 52: Calculation of power sums of deviations about the mean. Applied Statistics 21, 226-227.
See Also
var
.
Examples
set.seed(149)
x <- rnorm(1000)
z <- moments(x)
z
[Package fastmatrix version 0.5-772 Index]