Open
Description
The recursion used for calculating cumulants from a sequence of data is not numerically stable. Apparently this is known in the literature and is discussed in this paper:
https://www-2.rotman.utoronto.ca/~kan/papers/ncq.pdf
I offer a simple test showing that the cumulants of a gaussian vector, which should all be zero after the second one, diverge.
using StatsBase
using Plots
# create a long sampled vector from a normal distribution
N = 10000
v = randn(N)
# compute and plot the cumulants. Only the second
# one should be nonzero
kix = 1:15
rkstats = cumulant(v, kix)
plot(kix, rkstats)
Activity