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
GKConstantTimeSerieandGKExpandableTimeSerie. 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
Inherited by:
GKExpandableTimeSerie,GKConstantTimeSerieSynopsis¶
Methods¶
def
__init__()def
getDescription()def
getMax()def
getMean()def
getMin()def
getRMS()def
getSEMean()def
getStdDev()def
getSum()def
getTheilU()def
getTheilUmUcUs()def
getValue()def
isNull()def
isValid()def
nullValue()
Virtual methods¶
def
clear()def
getBand()def
getDeviation()def
getValue()def
hasAnyData()def
setValue()def
size()
Static functions¶
def
getRMS()def
getSEMean()def
getTheilU()def
getTheilUmUcUs()
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:
aDescripton –
GKTSDescription
- abstractmethod clear()¶
- filterTimeSerie(startTime, endTime[, considerDate=true])¶
Returns a vector with the values that are inside the interval [startTime, endTime].
Returns the aggregated deviation corresponding to the description’s aggregationType: -
eAggregationCustom:getCustomAggregatedDeviation()- otherAggregationType:getStdDev()ReturnsnullValue()if there is no description or if the aggregationType iseAggregationUndefined.- getAggregatedDeviation(aggregationType)
- Parameters:
aggregationType –
AggregationType- Return type:
Returns the aggregation deviation corresponding to the specified aggregationType.
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:
aggregationType –
AggregationType- Return type:
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
nullValueis 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]
Returns the external aggregated deviation previously set if any or
nullValueif not set.Returns the external aggregated value previously set.
- getDescription()¶
- Return type:
The description for this TS
- abstractmethod getDeviation(interval[, valid=None])¶
- Parameters:
interval – int
valid – bool
- Return type:
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
nullValueis returned and valid will be set to false.- getMax(start, end)
- Parameters:
start – int
end – int
- Return type:
- getMean(start, end)
- Parameters:
start – int
end – int
- Return type:
- getMin(start, end)
- Parameters:
start – int
end – int
- Return type:
- getRMS(other)¶
- Parameters:
other –
GKTimeSerie- Return type:
Returns the RMS (Root Mean Squared) error.
- static getRMS(serie1, serie2)
- Parameters:
serie1 – .list of double
serie2 – .list of double
- Return type:
This is an overloaded member function, provided for convenience. It behaves essentially like the
getRMS(constGKTimeSerie& serie1) function.- getSEMean(other)¶
- Parameters:
other –
GKTimeSerie- Return type:
Square error mean.
- static getSEMean(serie1, serie2)
- Parameters:
serie1 – .list of double
serie2 – .list of double
- Return type:
This is an overloaded member function, provided for convenience. It behaves essentially like the
getSEMean( constGKTimeSerie& serie2 ) function.Standard deviation.
- getSum(start, end)
- Parameters:
start – int
end – int
- Return type:
- getTheilU(other)¶
- Parameters:
other –
GKTimeSerie- Return type:
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:
Theil’s U_statistic: serie1 is the observed series, “serie2” is the forecasted series.
- getTheilUmUcUs(other, SEm, Um, Uc, Us)¶
- Parameters:
other –
GKTimeSerieSEm – float
Um –
doubleUc –
doubleUs –
double
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
Um –
doubleUc –
doubleUs –
double
This is an overloaded member function, provided for convenience. It behaves essentially like the
getTheilUmUcUsfunction ommiting the first parameter.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
nullValueis 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
nullValueis returned and valid will be set to false.Returns true if this object has data: at least one element that is not null (and valid).
Methods to check if aggregated is valid
- isAggregatedValid(aValidValues)
- Parameters:
aValidValues – int
- Return type:
Checks if the parameter value is considered invalid by this Time Serie. Depends on description. * Provided to be used commonly after a
getValueor any other returning function.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).