2
votes

We have the following values for time series which are irregularly spaced:

Lines <- "20/03/2014,9996792524
21/04/2014,8479115468
21/09/2014,11394750532
16/10/2014,9594869828
18/11/2014,10850291677
08/12/2014,10475635302
22/01/2015,10116010939
26/02/2015,11206949341
20/03/2015,11975140317
09/04/2015,11526960332
29/04/2015,9986194500
16/09/2015,,11501088256
13/10/2015,11833183163
10/11/2015,13246940910
16/12/2015,13255698568
27/01/2016,13775653990
23/02/2016,13567323648
22/03/2016,14607415705
11/04/2016,13835444224
04/04/2016,14118970743"

We wish to convert this into a time series and then fill in the gaps using some form of interpolation (using na.appox() maybe?). How do we interpolate this time series data in R to make it regularly spaced so that we can do some forecasting? We already tried a bunch of forecasting models like ARIMA. However, they all expect regularly spaced data.

1
@ZheyuanLi As it happens, the data is the output of a device over a duration of 4 years in 1 minute intervals (lots of data values). We found peaks in that data over time (that is what these values are). There are bunch of other limitations on the border device providing these values because of which obtaining a nice monthly time series is not possible. Otherwise, I wouldn't be making things so complicated.learnerX

1 Answers

0
votes

Take a look at the na.interp() function in the "forecast" package.