A Complete Introduction To Time Series Analysis (with R):: Models with Structure

Hair Parra
Analytics Vidhya
Published in
4 min readMay 4, 2020

--

Linear and quadratic trend fitting for the Lake Huron time-series data

Last time, we studied three important examples of semi-parametric models: the IID Noise, White Noise, and the Random Walk processes. We would now like to explore models with structure; i.e. that are constructed on the previous and have certain particular characteristics. Let’s dive right into it.

Trend Decomposition Model

The trend-decomposition model is constructed as follows:

So what is mt ? This stands for the trend, and Yt stands for the noise. In fact, we usually assume it to be white noise. The idea then is that although the observations are indeed quite random, on the average, they do seem to follow or “dance around” some kind of function, according to the time. We will come back to this idea later. How do we know what this trend actually is, though? Answer: we can use calculus and optimization to find what the most-likely function would be, i.e.

we are minimizing the square error loss. We will explain more in detail what mt should be in a later article; for now, think that we could do something in R like the following:

How to R

--

--

Hair Parra
Analytics Vidhya

Data Scientist & Data Engineer. CS, Stats & Linguistics graduate. Polyglot.