You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
Thank you so much for opening this issue! Would you be willing to open a PR implementing the more precise algorithms? (Is there any performance cost to doing so?)
Thank you so much for opening this issue! Would you be willing to open a PR implementing the more precise algorithms? (Is there any performance cost to doing so?)
I'll look into it. I haven't tried to implement the one in the paper. Since it requires a solution to an eigenvalue problem it may be slower, but correctness is of course more important.
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.
The text was updated successfully, but these errors were encountered: