Description Usage Arguments Details Methods (by class) Note See Also Examples
Return a time series with differences over a fixed time horizon.
1 2 3 4 |
x |
a time series object. |
... |
further arguments passed to or from methods. |
by |
a finite |
scale |
on which scale to calculate differences. Either |
The time series difference at observation time t
for time horizon by
is calculated between the values x_t
and x[t - by]
on a suitable scale. Here, x[t - by]
is the sampled value of x
at time t - by
, see sample_values
.
Observations times for which no difference can be calculated (i.e. times t_i
with t_i - by < t_1
) are dropped from the output.
uts
: rolling difference for a "uts"
object.
For an evenly spaced time series, calculating differences over (1) a certain number of observations (e.g. over four observations for quarterly data), and (2) over a fixed time horizon (e.g. over one year) gives the same result. For unevenly spaced time series, however, these two operations are quite different.
diff
allows to calculate differences over a fixed number of observations, as opposed to time horizon.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.