VectorExtensions.PeriodToDateValues Method

Definition

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

Overload List

PeriodToDateValues(Vector<Double>, Int32[], BoundaryIntervalBehavior, BoundaryIntervalBehavior) Returns a vector whose observations are the cumulative sum over intervals of observations.
PeriodToDateValues(Vector<Double>, Vector<DateTime>, Vector<DateTime>, BoundaryIntervalBehavior, BoundaryIntervalBehavior) Returns a vector whose observations are the cumulative sum over intervals of observations.

PeriodToDateValues(Vector<Double>, Int32[], BoundaryIntervalBehavior, BoundaryIntervalBehavior)

Returns a vector whose observations are the cumulative sum over intervals of observations.
C#
public static Vector<double> PeriodToDateValues(
	this Vector<double> vector,
	int[] bounds,
	BoundaryIntervalBehavior startBehavior,
	BoundaryIntervalBehavior endBehavior
)

Parameters

vector  Vector<Double>
The vector to transform.
bounds  Int32[]
An integer array containing the indexes of the boundaries of the intervals.
startBehavior  BoundaryIntervalBehavior
A BoundaryIntervalBehavior that specifies how to treat observations before the first entry in bounds.
endBehavior  BoundaryIntervalBehavior
A BoundaryIntervalBehavior that specifies how to treat observations after the last entry in bounds.

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

A common use for this method is to create period-to-date sum of a time series vector relative to a longer time frame. For example, if the vector contains monthly earnings, you can use this method to calculate the earnings to date per quarter.

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

Exceptions

ArgumentNullException

bounds is null.

PeriodToDateValues(Vector<Double>, Vector<DateTime>, Vector<DateTime>, BoundaryIntervalBehavior, BoundaryIntervalBehavior)

Returns a vector whose observations are the cumulative sum over intervals of observations.
C#
public static Vector<double> PeriodToDateValues(
	this Vector<double> vector,
	Vector<DateTime> startOfPeriod,
	Vector<DateTime> startOfSummaryPeriod,
	BoundaryIntervalBehavior startBehavior,
	BoundaryIntervalBehavior endBehavior
)

Parameters

vector  Vector<Double>
The vector to transform.
startOfPeriod  Vector<DateTime>
A Vector<T> of DateTime that specifies the dates corresponding to each observation of the vector.
startOfSummaryPeriod  Vector<DateTime>
A Vector<T> of DateTime that specifies the starting point of each summary period.
startBehavior  BoundaryIntervalBehavior
A BoundaryIntervalBehavior that specifies how to treat observations before the first entry in startOfSummaryPeriod.
endBehavior  BoundaryIntervalBehavior
A BoundaryIntervalBehavior that specifies how to treat observations after the last entry in startOfSummaryPeriod.

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

A common use for this method is to create period-to-date sum of a time series vector relative to a longer time frame. For example, if the vector contains monthly earnings, you can use this method to calculate the earnings to date per quarter.

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

Exceptions

ArgumentNullException

startOfPeriod is null.

-or-

startOfSummaryPeriod is null.

DimensionMismatchException

The length of startOfPeriod does not equal the length of the numerical vector.

See Also