PyANGKernel.GKTimeSerie

class GKTimeSerie

A time series is a collection of values taken starting at some time and every certain time interval.

Details

It is an abstract class. The derived classes are GKConstantTimeSerie and GKExpandableTimeSerie . The difference between the derived are the management of the values. The constant are created from a pool where their sizes are fixed, they are fastest. The expandable one can expand their values, modifying their initial number of intervals (usually used to cover the case of TS depends on each time-step; SI).

The TSDescription contains information about the time range, the interval between each value, units… This description is shared among all the TS that use it.

It can have, optionally, either a deviation for each value or a band (a Max and a min value).

See also

GKTSDescription

Inherited by: GKExpandableTimeSerie, GKConstantTimeSerie

Synopsis

Methods

Virtual methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class AggStat
__init__(aDescripton)
Parameters:

aDescriptonGKTSDescription

abstractmethod clear()
filterTimeSerie(startTime, endTime[, considerDate=true])
Parameters:
Return type:

.list of double

Returns a vector with the values that are inside the interval [startTime, endTime].

getAggregatedDeviation()
Return type:

float

Returns the aggregated deviation corresponding to the description’s aggregationType: - eAggregationCustom : getCustomAggregatedDeviation() - other AggregationType : getStdDev() Returns nullValue() if there is no description or if the aggregationType is eAggregationUndefined .

getAggregatedDeviation(aggregationType)
Parameters:

aggregationTypeAggregationType

Return type:

float

Returns the aggregation deviation corresponding to the specified aggregationType.

getAggregatedValue()
Return type:

float

Returns the aggregation corresponding to the description’s aggregationType Returns nullValue() if there is no description, or if the aggregationType is not supported. Supported aggregationType are : eAggregationCustom , eAggregationMean , eAggregationSum .

getAggregatedValue(aggregationType)
Parameters:

aggregationTypeAggregationType

Return type:

float

Returns the aggregation corresponding to the specified aggregationType.

abstractmethod getBand(interval[, valid=None])
Parameters:
  • interval – int

  • valid – bool

Return type:

.std.pairdouble,double

Returns the band for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then nullValue is returned and valid will be set to false.

If the TS contains only deviations it returns a band calculated using the deviation [Value+DEV,Value-DEV]

abstractmethod getCustomAggregatedDeviation()
Return type:

float

Returns the external aggregated deviation previously set if any or nullValue if not set.

abstractmethod getCustomAggregatedValue()
Return type:

float

Returns the external aggregated value previously set.

getDescription()
Return type:

GKTSDescription

The description for this TS

abstractmethod getDeviation(interval[, valid=None])
Parameters:
  • interval – int

  • valid – bool

Return type:

float

Returns the deviation for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then nullValue is returned and valid will be set to false.

getMax()
Return type:

float

getMax(start, end)
Parameters:
  • start – int

  • end – int

Return type:

float

getMean()
Return type:

float

getMean(start, end)
Parameters:
  • start – int

  • end – int

Return type:

float

getMin()
Return type:

float

getMin(start, end)
Parameters:
  • start – int

  • end – int

Return type:

float

getRMS(other)
Parameters:

otherGKTimeSerie

Return type:

float

Returns the RMS (Root Mean Squared) error.

static getRMS(serie1, serie2)
Parameters:
  • serie1 – .list of double

  • serie2 – .list of double

Return type:

float

This is an overloaded member function, provided for convenience. It behaves essentially like the getRMS (const GKTimeSerie & serie1) function.

getSEMean(other)
Parameters:

otherGKTimeSerie

Return type:

float

Square error mean.

static getSEMean(serie1, serie2)
Parameters:
  • serie1 – .list of double

  • serie2 – .list of double

Return type:

float

This is an overloaded member function, provided for convenience. It behaves essentially like the getSEMean ( const GKTimeSerie & serie2 ) function.

getStdDev()
Return type:

float

Standard deviation.

getSum()
Return type:

float

getSum(start, end)
Parameters:
  • start – int

  • end – int

Return type:

float

getTheilU(other)
Parameters:

otherGKTimeSerie

Return type:

float

Theil’s U_statistic: “this” is the observed series, “serie2” is the forecasted series.

static getTheilU(serie1, serie2)
Parameters:
  • serie1 – .list of double

  • serie2 – .list of double

Return type:

float

Theil’s U_statistic: serie1 is the observed series, “serie2” is the forecasted series.

getTheilUmUcUs(other, SEm, Um, Uc, Us)
Parameters:
  • otherGKTimeSerie

  • SEm – float

  • Umdouble

  • Ucdouble

  • Usdouble

Theil’s statistics: “this” is the observed series, “serie2” is the forecasted series. The SEm is the squared mean returned by function getSEMean .

static getTheilUmUcUs(serie1, serie2, SEm, Um, Uc, Us)
Parameters:
  • serie1 – .list of double

  • serie2 – .list of double

  • SEm – float

  • Umdouble

  • Ucdouble

  • Usdouble

This is an overloaded member function, provided for convenience. It behaves essentially like the getTheilUmUcUs function ommiting the first parameter.

getValue(context)
Parameters:

contextGKContext

Return type:

std::pair<double,bool>

Returns the value for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then nullValue is returned and valid will be set to false.

abstractmethod getValue(interval)
Parameters:

interval – int

Return type:

std::pair<double,bool>

Returns the value for an interval and the optional valid value is set to true. If the interval is greater than the current number of intervals then nullValue is returned and valid will be set to false.

abstractmethod hasAnyData()
Return type:

bool

Returns true if this object has data: at least one element that is not null (and valid).

isAggregatedValid()
Return type:

bool

Methods to check if aggregated is valid

isAggregatedValid(aValidValues)
Parameters:

aValidValues – int

Return type:

bool

isNull(value)
Parameters:

value – float

Return type:

bool

Checks if the parameter value is considered invalid by this Time Serie. Depends on description. * Provided to be used commonly after a getValue or any other returning function.

isValid(value)
Parameters:

value – float

Return type:

bool

nullValue()
Return type:

float

Returns the value that is considered not valid for the given Time Serie. Depends on description.

abstractmethod setCustomAggregatedValue(value[, deviation=-1.0])
Parameters:
  • value – float

  • deviation – float

Sets the aggregated value in case the type of aggregation is set to eAggregated, what means that it cannot be calculated and it needs to be user-specified.

setInvalidValue(aIntervalIndex)
Parameters:

aIntervalIndex – int

abstractmethod setValue(interval, value[, deviation=-1.0[, lowerValue=-1.0]])
Parameters:
  • interval – int

  • value – float

  • deviation – float

  • lowerValue – float

Sets the value and deviation or band for an interval. If the interval to be set is greater than the current number of intervals, empty intervals are added (values for these intervals will be nullValue ).

If lowerValue is >= 0 then deviation will be used as the higher value of the band (and lowerValue as the lower one).

abstractmethod size()
Return type:

int