moments | 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} \frac{\sum_{i=1}^n \left(x_i - mean(x)\right)^3}{sd(x)^{3}}
kurt = n^{-1} \frac{\sum_{i=1}^n \left(x_i - mean(x)\right)^4}{sd(x)^{4}} - 3
where n
is the size of x
.
See https://en.wikipedia.org/wiki/Skewness and https://en.wikipedia.org/wiki/Kurtosis for additional informations.
For information on the package and the Author, and for all the references, see nsRFA
.
mean
, var
, sd
, Lmoments
.
x <- rnorm(30,10,2)
moments(x)
data(hydroSIMN)
x <- annualflows["dato"][,]
cod <- annualflows["cod"][,]
sapply(split(x,cod),moments)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.