# Dealing with missing data in Time Series or non-constant time intervals for forecasting in R (ARIMA, Holt Winters, Theta)

I have a time series of sensor data from a machine. This machine is sometimes moved and thus there are big chunks of missing data, here is a plot of the data points:

My goal is to try to start building some basic forecasting models, I thought I would try Holt Winters, ARIMA, and Theta methods.

However I have noticed that the way these methods work (at least in R), is they expect a time series with constant time intervals instead of what I have:

> glimpse(test_df)
Observations: 19,086
Variables: 2
$System_Time <dttm> 2018-02-01 13:26:00, 2018-02-01 13:31:00,...$ System_Variable <int> 1240, 1400, 1210, 1270, 1230, 1170, 1180,...


I am fairly new to this and unsure how to proceed, as I can't use any functions like ts() without fixing this. My time series also says it has frequency = 1 even though it spans over several months.

I have tried running auto.arima just to see what happens and it just spits out a flat static line:

Trying to use holt winters is even worse, it just goes straight up.

I am unsure of what to do, I am guessing I could do something like interpolate? But that seems dodgy at best.

Aside from what has been suggested, you might use an state-space model (see packages such as dlm, KFAS and others in R). State-space models are quite tolerant to NA values in the data.