2014-02-20 02:49:11 +00:00
|
|
|
# Empirical cumulants for individual data
|
|
|
|
#
|
|
|
|
# Author: François Pelletier
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
#' Empirical cumulants for individual data
|
|
|
|
#' @param DATA a vector of individual data
|
|
|
|
#' @param order order of the cumulant. Must be between 1 and 4.
|
|
|
|
#' @return A vector of cumulants
|
2014-03-06 02:21:58 +00:00
|
|
|
#' @export emk
|
2014-02-20 02:49:11 +00:00
|
|
|
#' @author François Pelletier
|
|
|
|
emk <- function(DATA,order=1:4)
|
|
|
|
{
|
2014-02-22 00:00:37 +00:00
|
|
|
m <- actuar::emm(DATA,1:4)
|
2014-02-20 02:49:11 +00:00
|
|
|
c(m[1],
|
|
|
|
m[2]-m[1]^2,
|
|
|
|
m[3]-3*m[1]*m[2]+2*m[1]^2,
|
|
|
|
m[4]-3*m[2]^2-4*m[1]*m[3]+12*m[1]^2*m[2]-6*m[1]^4)[order]
|
|
|
|
}
|