FourierStuff/R/empCF.R
2014-03-05 21:21:58 -05:00

18 lines
483 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
#' @export empCF
#' @author François Pelletier
empCF <- function(t,DATA)
{
colMeans(outer(DATA,t,function(x,y) exp(1i*x*y)))
}