Database Reference
In-Depth Information
duration of the temporal extent on which the function is defined, and Length
returns the length of the curve defined by the function. These operations are
defined as follows:
￿ Integral : T f ( x ) dx .
￿ Duration : T dx .
￿ Length : T 1+ d dx 2 dx .
From these operations, other derived operations can be defined. These are
prefixed with a ' T ' (temporal) in order to distinguish them from the usual
aggregation operations generalized to temporal types, which we discuss
below.
￿ TAvg : Integral / Duration .
￿ TVariance : T
( f ( x ) TAvg ) 2
Duration
dx .
￿ TStDev : TVariance .
For example, the operation TAvg computes the weighted average of a
temporal value, taking into account the duration in which the function
takes a value. In our example, TAvg(SalaryJohn) will yield 23.25, given that
John had a salary of 20 during 182 days and a salary of 30 during 92
days. Further, TVariance and TStDev compute the variance and the standard
deviation of a temporal type. Finally, TMin and TMax return, respectively,
the minimum and maximum value taken by the function. These are obtained
by Min(RangeValues(
·
)) and Max(RangeValues(
·
)) where Min and Max are the
classic operations over numeric values.
The generalization of the operations on nontemporal types to temporal
types is called lifting. Lifting an operation over nontemporal types replaces
any of its argument types by the respective temporal type and returns a
temporal type. As an example, the less than ( < ) operation has lifted versions
where one or both of its arguments can be temporal types and the result is a
temporal Boolean. Intuitively, the semantics of such lifted operations is that
the result is computed at each instant using the nonlifted operation.
Several definitions of an operation may be applied when combining two
temporal types defined on different temporalextents.Afirstsolutioncould
be that the result is defined in the intersection of both extents and undefined
elsewhere. Another solution could be that the result is defined on the union
of the two extents, and a default value (like 0, for the addition) is used for
the extents that belong to only one temporal type. For the lifted operations,
we assume that the result is defined in the intersection of both extents.
Analogously, aggregation operations can also be lifted. For example, a lifted
Avg operation combines a set of temporal reals and results in a new temporal
real where the average is computed at each instant . As an example, given the
two temporal values above, Avg(
) givesasresulta
temporal real whose graphical representation is given in Fig. 12.2 .
{
SalaryJohn, SalaryMary
}
 
Search WWH ::




Custom Search