This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Description
Hi,
there seems to be a bug in Accord.Statistics.Analysis.ContrastFunctions.Kurtosis.cs
The Evaluate function reads
public void Evaluate(double[] x, double[] output, double[] derivative)
{
for (int j = 0; j < x.Length; j++)
{
// Kurtosis contrast function and its derivative, as given
// in original Hyvärinen's paper. See main references for the
// Independent Component Analysis class for details.
double v = x[j];
// g(w*x)
output[j] = v * v * v;
// g'(w*x)
derivative[j] = (1.0 / 3.0) * v * v;
}
}
However, the derivative should be:
derivative[j] = 3.0 * v * v;
This can be confirmed for example with the ComputeTest() unit test in Accord.Tests.Statistics.IndependentComponentAnalysisTest: Setting ica.Contrast = new Kurtosis(); before computing the ICA fails the test with the old derivative and succeeds with the new one.
Armin