Apparently Math.Net library does not contain a function for obtaining the autocorrelation of a sample.
How can this be achievied using the same library?
Apparently Math.Net library does not contain a function for obtaining the autocorrelation of a sample.
How can this be achievied using the same library?
The function:
double ACF<T>(IEnumerable<T> series, int lag, Func<T, double> f)
in MathNet.Numerics.Statistics.Mcmc
calculates an autocorrelation.
An example of using it is in the unit test.
A snippet from it is:
var series = new double[length];
for (int i = 0; i < length; i++)
{ series[i] = RandomSeries(); }
double result = MCMCDiagnostics.ACF(series, lag, x=>x*x);