<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/the-case-against-seasonal-unit-roots/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://firstdifferences.wordpress.com/2017/06/05/the-case-against-seasonal-unit-roots-3/"> R – first differences</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>There are several ways to model seasonality in a time series. Traditionally, trend-cycle decomposition such as the Holt-Winters procedure has been very popular. Also, until today applied researchers often try to account for seasonality by using seasonal dummy variables. But of course, in a stochastic process it seems unreasonable to assume that seasonal effects are purely deterministic. Therefore, in a time series context seasonal extensions of the classical ARMA model are very popular. One of these extensions is the seasonal unit root model</p>
<p><img title="(1-L^S)X_t=u_t," alt="(1-L^S)X_t=u_t," class="latex" src="https://s0.wp.com/latex.php?latex=%281-L%5ES%29X_t%3Du_t%2C&bg=f3f3f3&%23038;fg=404040&%23038;s=0"></p>
<p>where <img title="LX_t=X_{t-1}" alt="LX_t=X_{t-1}" class="latex" src="https://s0.wp.com/latex.php?latex=LX_t%3DX_%7Bt-1%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> is the usual lag operator and <img title="S" alt="S" class="latex" src="https://s0.wp.com/latex.php?latex=S&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> is the period length of the seasonality such as <img title="4" alt="4" class="latex" src="https://s0.wp.com/latex.php?latex=4&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> or <img title="12" alt="12" class="latex" src="https://s0.wp.com/latex.php?latex=12&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> for a yearly cycle in quarterly or monthly data and <img title="u_t" alt="u_t" class="latex" src="https://s0.wp.com/latex.php?latex=u_t&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> is some short run component such as an <img title="iid" alt="iid" class="latex" src="https://s0.wp.com/latex.php?latex=iid&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> innovation term or a SARMA(p,q)-(P,Q) model.</p>
<p>I have always been puzzled about the popularity of this process. Probably it is due to the obvious conceptual simplicity. It also seems to be a natural extension of the usual non-seasonal integrated ARIMA model. However, the model generates a feature that we will hardly ever observe in an actual time series: as time progresses the difference between consecutive values of the will become infinitely large.</p>
<p>To see this consider the following example. To generate seasonal unit root processes we first define a function that generates seasonal sums.</p>
<pre><code>seasonal_sum&lt;-function(data,S){
  out&lt;-data
  for(t in (S+1):length(data)){out[t]&lt;-data[t]+out[(t-S)]}
  out
}</code></pre>
<p>We then generate a sample of 250 observations from the process and look at its plot and its autocorrelation function. We choose a period of <img title="S=12" alt="S=12" class="latex" src="https://s0.wp.com/latex.php?latex=S%3D12&bg=f3f3f3&%23038;fg=404040&%23038;s=0">, so that the example resembles a yearly cycle in monthly data.</p>
<pre><code>series&lt;-seasonal_sum(rnorm(250),S=12)
acf(series)</code></pre>
<p><img width="450" src="https://i0.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-2-1.png?ssl=1&w=450"></p>
<pre><code>ts.plot(series, ylab=&quot;series&quot;, xlab=&quot;t&quot;)</code></pre>
<p><img width="450" src="https://i2.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-2-21.png?ssl=1&w=450"></p>
<p>From the autocorrelation function (ACF) it can be seen that there is a pronounced seasonal behavior with a spike in the ACF at each lag that is an integer multiple of <img title="S" alt="S" class="latex" src="https://s0.wp.com/latex.php?latex=S&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. However, the plot of the series shows a curious behavior. As <img title="t" alt="t" class="latex" src="https://s0.wp.com/latex.php?latex=t&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> increases, we see that the difference between two consecutive observations <img title="Delta X_t=X_t-X_{t-1}" alt="Delta X_t=X_t-X_{t-1}" class="latex" src="https://s0.wp.com/latex.php?latex=%5CDelta+X_t%3DX_t-X_%7Bt-1%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> increases. This behavior becomes even more pronounced if we increase the sample size to 2500.</p>
<pre><code>ts.plot(seasonal_sum(rnorm(2500),S=12), ylab=&quot;series&quot;)</code></pre>
<p><img width="450" src="https://i0.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-3-1.png?ssl=1&w=450"></p>
<p>To understand this feature consider the usual unit root model with an <img title="iid" alt="iid" class="latex" src="https://s0.wp.com/latex.php?latex=iid&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> innovation <img title="varepsilon_t" alt="varepsilon_t" class="latex" src="https://s0.wp.com/latex.php?latex=%5Cvarepsilon_t&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> with variance <img title="sigma_varepsilon^2" alt="sigma_varepsilon^2" class="latex" src="https://s0.wp.com/latex.php?latex=%5Csigma_%5Cvarepsilon%5E2&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. This can be expressed as the sum over all past innovations.</p>
<p><img title="X_t=(1-L)^{-1}varepsilon_t=sum_{i=0}^t varepsilon_{t-i}." alt="X_t=(1-L)^{-1}varepsilon_t=sum_{i=0}^t varepsilon_{t-i}." class="latex" src="https://s0.wp.com/latex.php?latex=X_t%3D%281-L%29%5E%7B-1%7D%5Cvarepsilon_t%3D%5Csum_%7Bi%3D0%7D%5Et+%5Cvarepsilon_%7Bt-i%7D.&bg=f3f3f3&%23038;fg=404040&%23038;s=0"></p>
<p>From this representation it is easy to show that the variance of the process is given by</p>
<p><img title="Var(X_t)=t sigma_varepsilon^2," alt="Var(X_t)=t sigma_varepsilon^2," class="latex" src="https://s0.wp.com/latex.php?latex=Var%28X_t%29%3Dt+%5Csigma_%5Cvarepsilon%5E2%2C&bg=f3f3f3&%23038;fg=404040&%23038;s=0"></p>
<p>so that the variance becomes infinite as <img title="t" alt="t" class="latex" src="https://s0.wp.com/latex.php?latex=t&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> approaches infinity. This is a property that seems to apply to many economic and financial time series and is therefore completely reasonable.</p>
<p>Now, the seasonal unit root model can be expressed in a similar way, but with an important twist. To see this, denote the <img title="s" alt="s" class="latex" src="https://s0.wp.com/latex.php?latex=s&bg=f3f3f3&%23038;fg=404040&%23038;s=0">th innovation in the <img title="i" alt="i" class="latex" src="https://s0.wp.com/latex.php?latex=i&bg=f3f3f3&%23038;fg=404040&%23038;s=0">th repetition of the cycle of length <img title="S" alt="S" class="latex" src="https://s0.wp.com/latex.php?latex=S&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> by <img title="eta_{i}^{(s)}" alt="eta_{i}^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_%7Bi%7D%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. This means that if you have monthly observations the innovation in the first January in the sample is <img title="eta_1^{(1)}" alt="eta_1^{(1)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_1%5E%7B%281%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> and the innovation in the second January in the sample is <img title="eta_2^{(1)}" alt="eta_2^{(1)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_2%5E%7B%281%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. By the same principle the innovation in the <img title="4" alt="4" class="latex" src="https://s0.wp.com/latex.php?latex=4&bg=f3f3f3&%23038;fg=404040&%23038;s=0">th December in the sample would be <img title="eta_4^{(12)}" alt="eta_4^{(12)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_4%5E%7B%2812%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. Therefore, any observation <img title="X_t=X_{i}^{(s)}" alt="X_t=X_{i}^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_t%3DX_%7Bi%7D%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">, for some <img title="i=1,..,n" alt="i=1,..,n" class="latex" src="https://s0.wp.com/latex.php?latex=i%3D1%2C..%2Cn&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> and <img title="s=1,...,S" alt="s=1,...,S" class="latex" src="https://s0.wp.com/latex.php?latex=s%3D1%2C...%2CS&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> can be represented as</p>
<p><img title="X_i^{(s)}=sum_{i=1}^n eta_{i}^{(s)}" alt="X_i^{(s)}=sum_{i=1}^n eta_{i}^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_i%5E%7B%28s%29%7D%3D%5Csum_%7Bi%3D1%7D%5En+%5Ceta_%7Bi%7D%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">.</p>
<p>The important thing to note here is that for two consecutive observations within the <img title="i" alt="i" class="latex" src="https://s0.wp.com/latex.php?latex=i&bg=f3f3f3&%23038;fg=404040&%23038;s=0">th repetition of the cycle we have <img title="X_t=X_i^{(s)}=sum_{i=1}^n eta_{i}^{(s)}" alt="X_t=X_i^{(s)}=sum_{i=1}^n eta_{i}^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_t%3DX_i%5E%7B%28s%29%7D%3D%5Csum_%7Bi%3D1%7D%5En+%5Ceta_%7Bi%7D%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> and <img title="X_{t-1}=X_i^{(s-1)}=sum_{i=1}^n eta_{i}^{(s-1)}" alt="X_{t-1}=X_i^{(s-1)}=sum_{i=1}^n eta_{i}^{(s-1)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_%7Bt-1%7D%3DX_i%5E%7B%28s-1%29%7D%3D%5Csum_%7Bi%3D1%7D%5En+%5Ceta_%7Bi%7D%5E%7B%28s-1%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0">. Since <img title="eta_{i}^{(s)}" alt="eta_{i}^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_%7Bi%7D%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> and <img title="eta_{i}^{(s-1)}" alt="eta_{i}^{(s-1)}" class="latex" src="https://s0.wp.com/latex.php?latex=%5Ceta_%7Bi%7D%5E%7B%28s-1%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> are independent streams of random numbers this means that <img title="X_i^{(s)}" alt="X_i^{(s)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_i%5E%7B%28s%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> and <img title="X_i^{(s-1)}" alt="X_i^{(s-1)}" class="latex" src="https://s0.wp.com/latex.php?latex=X_i%5E%7B%28s-1%29%7D&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> are independent random walks! Consequently, the difference of the process is given by</p>
<p><img title="Delta X_t=X_t-X_{t-1}=X_{i}^{(s)}-X_{i}^{(s-1)}=sum_{i=1}^n eta_i^{(s)}-eta_i^{(s-1)}," alt="Delta X_t=X_t-X_{t-1}=X_{i}^{(s)}-X_{i}^{(s-1)}=sum_{i=1}^n eta_i^{(s)}-eta_i^{(s-1)}," class="latex" src="https://s0.wp.com/latex.php?latex=%5CDelta+X_t%3DX_t-X_%7Bt-1%7D%3DX_%7Bi%7D%5E%7B%28s%29%7D-X_%7Bi%7D%5E%7B%28s-1%29%7D%3D%5Csum_%7Bi%3D1%7D%5En+%5Ceta_i%5E%7B%28s%29%7D-%5Ceta_i%5E%7B%28s-1%29%7D%2C&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> </p>
<p>so that</p>
<p><img title="Var(Delta X_t)= 2n Var(eta_i^{(s)})." alt="Var(Delta X_t)= 2n Var(eta_i^{(s)})." class="latex" src="https://s0.wp.com/latex.php?latex=Var%28%5CDelta+X_t%29%3D+2n+Var%28%5Ceta_i%5E%7B%28s%29%7D%29.&bg=f3f3f3&%23038;fg=404040&%23038;s=0"></p>
<p>Since <img title="n" alt="n" class="latex" src="https://s0.wp.com/latex.php?latex=n&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> goes to infinity as <img title="t" alt="t" class="latex" src="https://s0.wp.com/latex.php?latex=t&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> goes to infinity, so does the variance of the changes. Has anybody ever seen a series that exhibits such a feature? Of course in reality we would expect that the innovations are not <img title="iid" alt="iid" class="latex" src="https://s0.wp.com/latex.php?latex=iid&bg=f3f3f3&%23038;fg=404040&%23038;s=0"> but show some kind of dependence structure, so that the random walks are not completely independent anymore. However, if the dependence is weak – such as that of an ARMA process – they are still asymptotically independent for large lags. Therefore, the same issue arises, as can be seen from the example below.</p>
<pre><code>sarima_sim&lt;-function(T, S, arma_model){
  arma_series&lt;-arima.sim(n=T, model=arma_model)
  seasonal_sum(data=arma_series, S=S)
}

sarima_series&lt;-sarima_sim(T=250, S=12, arma_model=list(ar=c(0.5,0.3)))

acf(sarima_series)</code></pre>
<p><img width="450" src="https://i1.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-4-1.png?ssl=1&w=450"></p>
<pre><code>ts.plot(sarima_series, ylab=&quot;series&quot;)</code></pre>
<p><img width="450" src="https://i1.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-4-2.png?ssl=1&w=450"></p>
<pre><code>ts.plot(sarima_sim(T=2500, S=12, arma_model=list(ar=c(0.5,0.3))), ylab=&quot;series&quot;)</code></pre>
<p><img width="450" src="https://i0.wp.com/firstdifferences.files.wordpress.com/2017/06/unnamed-chunk-4-3.png?ssl=1&w=450"></p>
<p>So what is the conclusion from all this? The seasonal unit root process seems to be ill suited to model most behavior that we observe in practice. However, it is well known that it often generates a good fit. Especially in shorter time series the drawbacks of the seasonal unit root process do not have to become visible. Nevertheless, I think it is fair to say that one could envision a more satisfactory model. One avenue that seems very useful in this context is that of seasonal long memory processes that are able to combine some persistence in the cyclical fluctuations with a finite variance.</p>
<p>Another important conclusion is that we have to be careful with seemingly direct extensions of standard models such as the ARIMA. The fact that the ARIMA is extremely successful in modelling the non-seasonal component, does not necessarily mean that the SARIMA is a good model for the seasonal applications that we have in mind, too.</p>
<p>Filed under: <a target="_blank" rel="nofollow" href="https://firstdifferences.wordpress.com/category/allgemein/">Allgemein</a>, <a target="_blank" rel="nofollow" href="https://firstdifferences.wordpress.com/category/r/">R</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstdifferences.wordpress.com/129/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/firstdifferences.wordpress.com/129/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://firstdifferences.wordpress.com/2017/06/05/the-case-against-seasonal-unit-roots-3/"> R – first differences</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...

	<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/Qgyjv66kKiE"></a></div>