Skip to content
Prev 377797 / 398502 Next

Functional data anlysis for unequal length and unequal width time series

You will learn something useful if you search for "rolling join". The zoo package can handle this, as can the data.table package (read the vignette).

Your decision to pad with NA at the end was ill-considered... the first point of your first series is between the first two points of your second series... you need to interleave the points somehow.

You will need to decide whether you want to use piecewise linear approximation (as with the base "approx" function) or the more stable last-observation-carried-forward ("locf") or cubic splines or something more exotic like Fourier interpolation to identify the new interpolated "y" values in each series.

You can avoid the rolling join if you intend to resample the series to have points at regular intervals.  Just apply your preferred interpolation technique with your intended mesh of regular time values to each of your series in turn and then use cbind with the results.

I don't know anything about the package you mention, but getting time series data aligned is a common preprocessing step for many time series analysis.

Oh, and to you should probably be familiar with that CRAN Time Series Task View [1].

PS you should provide a link back to your original posting when moving the conversation to a different venue in case the discussion doesn't stay dead there.

[1] https://cran.r-project.org/web/views/TimeSeries.html
On December 17, 2018 8:50:09 AM PST, soura at iastate.edu wrote: