Click or drag to resize

SeriesAutocovariance Method (IReadOnlyListDouble)

Computes the auto-covariance for all lags.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
public static double[] Autocovariance(
	this IReadOnlyList<double> series


Type: System.Collections.GenericIReadOnlyListDouble
The data series.

Return Value

Type: Double
An array of auto-covariance values, with the array index equal to the lag index.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyListDouble. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

The computation of the auto-covariance for a given lag is an O(N) operation. Naively, the computation of the auto-covariance for all N possible lags is therefore an O(N^2) operation; this is in fact the cost of N invocations of Autocovariance(IReadOnlyListDouble, Int32). However, using Fourier techniques, it is possible to simultaneously compute the auto-covariance for all possible lags in O(N log N) operations. This method uses the Fourier technique and should be called if you require the auto-covariance for more than a handful of lag values.

See Also