Table of Contents

Class AutocovarianceFunctions

Namespace
NanoQL.Numerics
Assembly
NanoQL.dll

Convolutions, autocovariances and autocorrelations of a sequence, by the fast Fourier transform: the data's transform, its squared modulus, and that transformed again.

public static class AutocovarianceFunctions
Inheritance
AutocovarianceFunctions
Inherited Members

Remarks

Each function writes the lags 0 to maxLag into the first maxLag + 1 places of a caller's span. The overloads taking reuse accept data that isn't centred: they remove its mean, return it, and write the centred data back into the caller's span where reuse is true.

Methods

Autocorrelations(ReadOnlySpan<double>, Span<double>, int)

The unbiased autocorrelations of centred data for lags 0 to maxLag, the first place holding the unbiased sample variance.

public static void Autocorrelations(ReadOnlySpan<double> data, Span<double> output, int maxLag)

Parameters

data ReadOnlySpan<double>

The sequence, centred (of zero mean).

output Span<double>

The variance and the autocorrelations, at least maxLag + 1 places.

maxLag int

The last lag.

Exceptions

ArgumentOutOfRangeException

maxLag is negative.

ArgumentException

The output is shorter than maxLag + 1.

NanoQLException

maxLag isn't less than the data's size.

Autocorrelations(Span<double>, Span<double>, int, bool)

The unbiased autocorrelations for lags 0 to maxLag of data that needn't be centred, the first place holding the unbiased sample variance: the mean removed and returned.

public static double Autocorrelations(Span<double> data, Span<double> output, int maxLag, bool reuse)

Parameters

data Span<double>

The sequence; the centred sequence is written back into it where reuse is true.

output Span<double>

The variance and the autocorrelations, at least maxLag + 1 places.

maxLag int

The last lag.

reuse bool

Whether the centred sequence is written back into data.

Returns

double

The data's mean.

Exceptions

ArgumentOutOfRangeException

maxLag is negative.

ArgumentException

The output is shorter than maxLag + 1.

NanoQLException

maxLag isn't less than the data's size.

Autocovariances(ReadOnlySpan<double>, Span<double>, int)

The unbiased autocovariances of centred data, for lags 0 to maxLag.

public static void Autocovariances(ReadOnlySpan<double> data, Span<double> output, int maxLag)

Parameters

data ReadOnlySpan<double>

The sequence, centred (of zero mean).

output Span<double>

The autocovariances, at least maxLag + 1 places.

maxLag int

The last lag.

Exceptions

ArgumentOutOfRangeException

maxLag is negative.

ArgumentException

The output is shorter than maxLag + 1.

NanoQLException

maxLag isn't less than the data's size.

Autocovariances(Span<double>, Span<double>, int, bool)

The unbiased autocovariances for lags 0 to maxLag of data that needn't be centred: the mean removed and returned.

public static double Autocovariances(Span<double> data, Span<double> output, int maxLag, bool reuse)

Parameters

data Span<double>

The sequence; the centred sequence is written back into it where reuse is true.

output Span<double>

The autocovariances, at least maxLag + 1 places.

maxLag int

The last lag.

reuse bool

Whether the centred sequence is written back into data.

Returns

double

The data's mean.

Exceptions

ArgumentOutOfRangeException

maxLag is negative.

ArgumentException

The output is shorter than maxLag + 1.

NanoQLException

maxLag isn't less than the data's size.

Convolutions(ReadOnlySpan<double>, Span<double>, int)

The convolutions x₀xₙ + x₁xₙ₊₁ + x₂xₙ₊₂ + … for n = 0 to maxLag.

public static void Convolutions(ReadOnlySpan<double> data, Span<double> output, int maxLag)

Parameters

data ReadOnlySpan<double>

The sequence.

output Span<double>

The convolutions, at least maxLag + 1 places.

maxLag int

The last lag.

Exceptions

ArgumentOutOfRangeException

maxLag is negative.

ArgumentException

The output is shorter than maxLag + 1.

NanoQLException

maxLag isn't less than the data's size.