Downsample a multi-dimensional time series.
downsample(Xt, r, position = 1)
Arguments
- Xt
One or two-column matrix of observations.
- r
Integer of downsampling rate.
- position
Integer of position index for downsampled series, smaller than or equal to r
.
Value
An matrix of downsampled observation.
Details
Sample observations from original time series \(X = [X_0, X_2, X_3, ..., X_N]\) at constant rate r
. For given position index i
finally returns \(X_{ds} = [X_i, X_{i+r}, X_{i+2r}, ...]\).
Examples
# simulate a 2D fbm trajectory.
alpha <- 0.8
dt <- 1/60
N <- 1800
acf <- fbm_acf(alpha, dt, N)
dX <- SuperGauss::rnormtz(n = 2, acf = acf)
Xt <- apply(dX, 2, cumsum)
# downsample Xt by rate 2.
Xt_ds2 <- downsample(Xt, r = 2)