moments {nsRFA} | R Documentation |
moments
provides the estimate of the first 4 moment-statistics of a sample.
moments (x) CV (x) skew (x) kurt (x)
x |
vector representing a data-sample |
Skewness and kurtosis are defined as:
skew = n^(-1) sd(x)^(-3) sum_i (x_i - mean(x))^3
kurt = n^(-1) sd(x)^(-4) sum_i (x_i - mean(x))^4 - 3
where n is the size of x
.
Alberto Viglione, e-mail: alviglio@tiscali.it.
x <- rnorm(30,10,2) moments(x) data(hydroSIMN) x <- annualflows["dato"][,] cod <- annualflows["cod"][,] sapply(split(x,cod),moments)