# R: Predictive Analytics on Time series

I have a data frame as follows:

pressure    datetime
4.848374    2016-04-12 10:04:00
4.683901    2016-04-12 10:04:32
5.237860    2016-04-12 10:13:20


I would like to apply time series modeling to predict future pressure. However, is it possible to do just using one feature and how?

If pressure is auto-correlated, i.e. pressure today depends on pressure in a previous time period i.e. yesterday or an hour ago, then you can use ARIMA modelling. There are lots of resources out there to explain how to check for auto correlation in your data and how to create an ARIMA model.

Here is the generalised formula for the AR part of ARIMA:

Y$_{t}$ = α + β$_{1}$Y$_{t-1}$ +...+ β$_{i}$Y$_{t-i}$ + $\epsilon$

Y$_{t}$=pressure in time period $t$ and depends on pressure(s) in some previous time period(s) Y$_{t-i}$

Here's a great resource I've used to understand ARIMA modelling with application in R: https://www.otexts.org/fpp/8

Here's a more general explanation of ARIMA modelling:
https://people.duke.edu/~rnau/411arim.htm

• Thank you, I will have a look at the links. Since the sampling rate is high, do I need to aggregate pressure values per day in order to measure correlation? – cps Dec 15 '16 at 16:39
• You'll need to ensure measurements are evenly spaced so some sort of aggregating may need to take place. You could do it hourly or daily it depends on what detail you want your predictions to have. Predicting pressure every second isn't applicable to weather for example but might be applicable to a lab experiment. – Morgan Ball Dec 15 '16 at 16:43
• Thanks again, the data I have is only for 4 days, so I think I will need to aggregate it on hourly basis. Will that work? As the timestamps are not evenly spaced. – cps Dec 15 '16 at 16:47
• If you take the average for each hour it should do, that's plenty of data. If there are any hours with missing data you'll probably need to fill those, maybe with the average pressure in the adjacent hours so you have a complete time series. – Morgan Ball Dec 15 '16 at 16:51
• Ok, thanks, I will report it once I have some results. – cps Dec 15 '16 at 17:02