An Unevenly-spaced Time Series (uts) is a sequence of observation time and value pairs (tn, Xn) with strictly increasing observation times. As opposed to equally spaced time series, the spacing of observation times may not be constant.
| Time series operation | In terms of number of observations | In terms of time window |
|---------------------------------|------------------------------------|-------------------------|
| Get initial subperiod | head
| head_t
|
| Get terminal subperiod | tail
| tail_t
|
| Delay observations | lag
| lag_t
|
| Calculate differences over time | diff
| diff_t
|
| Get the length | length
| length_t
|
Methods that operate in terms of the number of observations typically specify that number using an integer argument.
On the other hand, methods that operate in terms of a time window typically have an argument specifying the temporal width (also know as duration) of this time window[^1]. The number of observations falling into this window depends on the observation density of the time series.
[^1]: length
and length_t
are exceptions. Instead of requiring an integer or duration argument, respectively, they return such a value.
R
uses a variety of rules for handling arithmetic between vectors and arrays of different lengths. These are commonly known as recycling rules, see Section 5.4.1 of "An introduction to R" for a complete list.
Arithmetic with uts
objects only keeps a few rules that do not make strong implicit assumptions about what exactly the user wants to do. Specifically:
uts
objects are always recycled.uts_vector
objects of length one are recycled.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.