VectorExtensions.ReferenceIndex Method

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3

Overload List

ReferenceIndex(Vector<Double>, Int32, Double) Returns a vector that represents an index value relative to the specified base value.
ReferenceIndex(Vector<Double>, Int32, Int32, Double) Returns a vector that represents an index value relative to the specified range of base value.

ReferenceIndex(Vector<Double>, Int32, Double)

Returns a vector that represents an index value relative to the specified base value.
C#
public static Vector<double> ReferenceIndex(
	this Vector<double> vector,
	int baseIndex,
	double indexBaseValue
)

Parameters

vector  Vector<Double>
The vector to transform.
baseIndex  Int32
The zero-based index of the observation that is to be used as the reference value.
indexBaseValue  Double
A real number that specifies the value of the index at the base value.

Return Value

Vector<Double>
A vector.

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).

Exceptions

ArgumentOutOfRangeException

baseIndex is less than zero or greater than or equal to the number of observations of the vector.

ReferenceIndex(Vector<Double>, Int32, Int32, Double)

Returns a vector that represents an index value relative to the specified range of base value.
C#
public static Vector<double> ReferenceIndex(
	this Vector<double> vector,
	int baseStartIndex,
	int baseEndIndex,
	double indexBaseValue
)

Parameters

vector  Vector<Double>
The vector to transform.
baseStartIndex  Int32
The zero-based index of the first reference value in the range.
baseEndIndex  Int32
The zero-based index of the last reference value in the range.
indexBaseValue  Double
A real number that specifies the value of the index at the base value.

Return Value

Vector<Double>
A vector.

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

The reference index is calculated relative to the sum of the observations in the specified range.

Exceptions

ArgumentOutOfRangeException

baseStartIndex is less than zero or greater than or equal to the number of observations of the vector.

-or-

baseEndIndex is less than zero or greater than or equal to the number of observations of the vector.

ArgumentException

baseStartIndex is greater than baseEndIndex.

See Also