FourierStuff/R/empCF.R
2014-02-19 21:49:11 -05:00

17 lines
466 B
R

# Empirical Characteristic function
#
# Author: François Pelletier
###############################################################################
#' Empirical Characteristic function
#'
#' Evaluate the empirical CF from a data sample
#' @param t Vector of transform variates
#' @param DATA Vector of individual data
#' @return A vector of CF values
#' @author François Pelletier
empCF <- function(t,DATA)
{
colMeans(outer(DATA,t,function(x,y) exp(1i*x*y)))
}