VectorExtensions.MovingSum Method

Returns a vector whose observations are the sum of a range of observations of the vector.

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
public static Vector<double> MovingSum(
	this Vector<double> vector,
	int length
)

Parameters

vector  Vector<Double>
The vector to transform.
length  Int32
The number of observations in the range.

Return Value

Vector<Double>

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<Double>. 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).

Remarks

If length is equal to 1, this method returns the original vector.

The new vector gets the name sum<length>(<name>), where <name> is the name of the original vector.

Exceptions

ArgumentOutOfRangeException

length is less than or equal to zero.

See Also