# Differences

This shows you the differences between two versions of the page.

 introduction [2019/05/04 20:54]a.leofreddi introduction [2019/05/09 16:39] (current)admin 2019/05/09 16:39 admin 2019/05/05 18:17 admin 2019/05/04 20:54 a.leofreddi 2019/05/04 19:15 a.leofreddi 2019/05/04 19:14 a.leofreddi 2019/05/04 19:13 a.leofreddi 2019/05/04 19:13 a.leofreddi 2019/05/04 17:14 a.leofreddi 2019/05/04 17:09 a.leofreddi 2019/05/04 17:06 a.leofreddi 2016/02/26 23:40 a.leofreddi 2016/02/26 23:39 a.leofreddi 2016/02/26 23:39 a.leofreddi 2016/02/26 22:19 a.leofreddi 2016/02/26 22:18 a.leofreddi 2015/10/28 20:34 a.leofreddi 2015/10/28 20:31 a.leofreddi created 2019/05/09 16:39 admin 2019/05/05 18:17 admin 2019/05/04 20:54 a.leofreddi 2019/05/04 19:15 a.leofreddi 2019/05/04 19:14 a.leofreddi 2019/05/04 19:13 a.leofreddi 2019/05/04 19:13 a.leofreddi 2019/05/04 17:14 a.leofreddi 2019/05/04 17:09 a.leofreddi 2019/05/04 17:06 a.leofreddi 2016/02/26 23:40 a.leofreddi 2016/02/26 23:39 a.leofreddi 2016/02/26 23:39 a.leofreddi 2016/02/26 22:19 a.leofreddi 2016/02/26 22:18 a.leofreddi 2015/10/28 20:34 a.leofreddi 2015/10/28 20:31 a.leofreddi created Line 68: Line 68: Without more data, we can assume that if he saved 36 kittens in 2 hours, he saved 18 each hour. So we can say that between 09:00 and 11:00, 18 kittens were saved. One hour later 38 kittens were saved (18 by A, and 20 by B)! Without more data, we can assume that if he saved 36 kittens in 2 hours, he saved 18 each hour. So we can say that between 09:00 and 11:00, 18 kittens were saved. One hour later 38 kittens were saved (18 by A, and 20 by B)! - Now let'​s ​compute the sum of the scores of A and B via TimEL: + And that'​s ​what TimEL will automatically do, because we feed it using an [[Integral]] ​variable. - + - + - Note that k<​sub>​i​ is a constant value in the range [a<​sub>​i,​ b<​sub>​i+1​) and that the interval duration depends on the sampling frequency of the discretization process, but TimEL does not make any assumption regarding the duration of intervals: both constant-duration and irregular intervals are accepted. + - + - The explicit reference to the interval underlying the validity of a value allows TimEL to clearly identify the undefined intervals - that is time intervals where the value is not available (or maybe just not available yet, for queue systems). + - + - This approach is suitable to express a number of various processes, as example: + - + - * The value of a stock quote for a given period; + - * The consumption read by a meter reading for a given period; + - * An average speed for the given interval for a given period. + - + - Below an example of TimEL code to evaluate A + B with the following values: + - + - <​HTML>​ + -
​ + - ​ + - + - <​JS>​ + - jQuery('#​container'​).highcharts({ + - // + - title: { text: '​Evaluation example'​ }, + - xAxis: { + - categories: ['​Jan',​ '​Feb',​ '​Mar',​ '​Apr',​ '​May',​ '​Jun',​ '​Jul',​ '​Aug',​ '​Sep',​ '​Oct',​ '​Nov',​ '​Dec',​ '​Jan'​] + - }, + - plotOptions:​ { + - series: { + - step: '​left'​ + - } + - }, + - series: [{ + - name: '​A',​ + - data: [ + - [0, 20], + - [3, 60], + - [9, 90], + - [12, 90], + - ] + - }, { + - name: '​B',​ + - data: [ + - [0, 100], + - [6, 130], + - [12, 130] + - ] + - }, { + - name: 'A + B', ​ + - data: [ + - [0, 120], + - [3, 160], + - [6, 190], + - [9, 220], + - [12, 220], + - ] + - }] + - // + - }); + - ​ + - + - As you can see, TimEL will split A in the interval [April, October) as B has a value change in July, keeping thus the highest granularity possible resampling the input when needed. + - + - Note that the resampling process behaves differently on the data type, for more information checkout ​ [[Interpolation]]. + - + - TimEL'​s expressivity comes mainly form the ability of model time recurrent events with a number of specific aggregation functions. + - + - As the data type is very important since it affects the computation,​ multiple resample functions are available to support both rescale and data type conversion on the fly when needed. + - + - The following basic function are available:​ + - + - * [[Scalar]] + - * [[Integral]] + - * [[Average]] + - + - Each of these functions receive the value to resample as first argument, and can be used with an optional 2nd argument which is the temporal interval to which the resample should be applied. + - + - Note that the temporal interval may be a fixed (defined using the [[Interval]] function) or a recurring one (defined using the [[Every]] function). + - + - When no interval is provided, an aggregation function will produce a single output with the longest interval possible. + - + - Follows an example of the following function, evaluated in the interval 2015-01-01 to 2015-02-01 (we use the ISO format to avoid confusion):​ + - + - + - + - +
• introduction.1557003293.txt.gz