Multivariate empirical characteristic function

Hi,

I am a Pythonista, yet totally new to Julia though.

Could someone, please, demonstrate an example on how to code an empirical characteristic function (ideally multivariate) in Julia-way?

That is, let’s say, we’ve got a matrix X of observations (m rows by n columns, where m is number of observations, n is dimension). So that, one could do smth like this:

ecf = estimate_ecf(X)
println(ecf(t))

P.S. I assume, that cf() from Distributions.jl isn’t much suitable for this

Hello,

If I understand the formula for the empirical characteristic function correctly, then it should just be

using Statistics: mean
estimate_ecf(X) = t -> mean(exp.(im * t .* X); dims=1)
# example
X = randn(20, 2)
ecf = estimate_ecf(X)
println(ecf(t))
# 1×2 Array{Complex{Float64},2}:
# 1.0+0.0im  1.0+0.0im
1 Like