Class TimeSeries
Treating time series as tuples of corrsponding dates/values
Inherited Members
Namespace: TimeSeriesAnalysis
Assembly: TimeSeriesAnalysis.dll
Syntax
public class TimeSeries
Methods
| Edit this page View SourceConcat((double[], DateTime[]), (double[], DateTime[]))
Creates a new timeseries that is var1 and var2 concatenated together
Declaration
public static (double[], DateTime[]) Concat((double[], DateTime[]) var1, (double[], DateTime[]) var2)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | var1 | |
(double[], DateTime[]) | var2 |
Returns
Type | Description |
---|---|
(double[], DateTime[]) |
GetClosestIndexToDate((double[], DateTime[]), DateTime)
Gt the index of the time-series that is closest to a given date
Declaration
public static int GetClosestIndexToDate((double[], DateTime[]) input, DateTime date)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | input | time-series tuple |
DateTime | date | the |
Returns
Type | Description |
---|---|
int |
GetGradient((double[], DateTime[]), int, int[])
Get the gradient of a time-series
Declaration
public static RegressionResults GetGradient((double[], DateTime[]) valueDateTuple, int sampleTime_sec = 1, int[] indicesToIgnore = null)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | valueDateTuple | a value/datetime array tuple |
int | sampleTime_sec | sample time in which to present the result |
int[] | indicesToIgnore | indices to ignore |
Returns
Type | Description |
---|---|
RegressionResults | The gradient is the gain of the returned object |
GetSubsetOfDays((double[], DateTime[]), int, int)
Clip out a subset of the given time-series with a given number of days.
By default it gives the last N days, but optionally
Declaration
public static (double[], DateTime[]) GetSubsetOfDays((double[], DateTime[]) input, int nSpanDays, int nDaysBack = 0)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | input | the original time-series to be clipped |
int | nSpanDays | the desired length of the returend dataset |
int | nDaysBack | the number of days to push the end of the returned dataset back(default is zero, in which case method gets last nSpanDays) |
Returns
Type | Description |
---|---|
(double[], DateTime[]) |
Reverse((double[], DateTime[]))
Reverses the order of the time-series
Declaration
public static (double[], DateTime[]) Reverse((double[], DateTime[]) input)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | input |
Returns
Type | Description |
---|---|
(double[], DateTime[]) |
SubSet((double[], DateTime[]), DateTime)
Get a subset starting at a specific date
Declaration
public static (double[], DateTime[]) SubSet((double[], DateTime[]) input, DateTime startDate)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | input | |
DateTime | startDate |
Returns
Type | Description |
---|---|
(double[], DateTime[]) |
SubSet((double[], DateTime[]), int, int)
Get a subset of a given value/datetime tuple, given start and end indices
Declaration
public static (double[], DateTime[]) SubSet((double[], DateTime[]) input, int startInd, int endInd)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | input | |
int | startInd | |
int | endInd |
Returns
Type | Description |
---|---|
(double[], DateTime[]) |