<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archives ARIMA - Open Forecasting</title>
	<atom:link href="https://openforecast.org/category/univariate-en/arima-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://openforecast.org/category/univariate-en/arima-en/</link>
	<description>How to look into the future</description>
	<lastBuildDate>Tue, 13 May 2025 11:59:32 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2015/08/cropped-usd-05-32x32.png&amp;nocache=1</url>
	<title>Archives ARIMA - Open Forecasting</title>
	<link>https://openforecast.org/category/univariate-en/arima-en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Fundamental Flaw of the Box-Jenkins Methodology</title>
		<link>https://openforecast.org/2025/05/13/fundamental-flaw-of-the-box-jenkins-methodology/</link>
					<comments>https://openforecast.org/2025/05/13/fundamental-flaw-of-the-box-jenkins-methodology/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Tue, 13 May 2025 11:57:07 +0000</pubDate>
				<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[Social media]]></category>
		<category><![CDATA[Univariate models]]></category>
		<category><![CDATA[extrapolation methods]]></category>
		<category><![CDATA[Information criteria]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=3838</guid>

					<description><![CDATA[<p>If you have taken a course on forecasting or time series analysis, you’ve probably heard of ARIMA and the Box–Jenkins methodology. In my opinion, this methodology has a fundamental flaw and should not be used in practice. Here&#8217;s why. When Box and Jenkins wrote their book back in the 1960s, it was a very different [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2025/05/13/fundamental-flaw-of-the-box-jenkins-methodology/">Fundamental Flaw of the Box-Jenkins Methodology</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you have taken a course on forecasting or time series analysis, you’ve probably heard of ARIMA and the Box–Jenkins methodology. In my opinion, <strong>this methodology has a fundamental flaw</strong> and should not be used in practice. Here&#8217;s why.</p>
<p>When Box and Jenkins wrote their book back in the 1960s, it was a very different era: computers were massive, and people worked with punch cards. To make their approach viable, Box and Jenkins developed a methodology for selecting the appropriate orders of AR and MA based on the values of the autocorrelation and partial autocorrelation functions (ACF and PACF, respectively). Their idea was that if an ARMA process generates a specific ACF/PACF pattern, then it could be identified by analysing those functions in the data. At the time, it wasn’t feasible to do cross-validation or rolling origin evaluation, and even using information criteria for model selection was a challenge. So, the Box–Jenkins approach was a sensible option, producing adequate results with limited computational resources, and was considered state of the art.</p>
<p>Unfortunately, as the M1 competition later showed (see my <a href="/2024/03/14/the-role-of-m-competitions-in-forecasting/">earlier post</a>), the methodology didn’t work well in practice. Simpler methods that didn’t rely on rigorous model selection actually performed better. But in fact, the winning model in the competition was ARARMA by Emanuel Parzen (https://doi.org/10.1002/for.3980010108). His idea was to make the series stationary by applying a low-order, non-stationary AR to the data, then extract residuals and select appropriate ARMA orders using AIC. Parzen ignored the Box–Jenkins methodology entirely &#8211; he didn’t analyse ACF or PACF and instead relied fully on automated selection. And it worked!</p>
<p>So why didn’t the Box–Jenkins methodology perform as expected? In my monograph <a href="/adam">Forecasting and Analytics with ADAM</a>, I use the following example to explain the main issue: “All birds have wings. Sarah has wings. Thus, Sarah is a bird.” But Sarah, as shown in the image attached to this post, is a butterfly.</p>
<p>The fundamental issue with the Box–Jenkins methodology lies in its logic: if a process generates a specific ACF/PACF, that doesn’t mean that an observed ACF/PACF must come from that process. Many ARMA and even non-ARMA processes can generate exactly the same autocorrelation structure.</p>
<p>Further developments in ARIMA modelling have shown that ACF and PACF can only be used as general guidelines for order selection. To assess model performance properly, we need other tools. All modern approaches rely on information criteria for ARIMA order selection, and they consistently perform well in forecasting competitions. For example, <a href="https://doi.org/10.18637/jss.v027.i03">Hyndman &#038; Khandakar (2008)</a> use AIC for ARMA order selection, while <a href="https://doi.org/10.1080/00207543.2019.1600764">Svetunkov &#038; Boylan (2020)</a> apply AIC after reformulating ARIMA in a state space form. The former is implemented in the forecast package in R and the StatsForecast library in Python (thanks to Nixtla and Azul Garza); the latter is available in the smooth package in R. I also discuss another ARIMA order selection approach in <a href="/adam/ARIMASelection.html">Section 15.2 of my book</a>.</p>
<p>Long story short: don’t use the Box–Jenkins methodology for order selection. Use more modern tools, such as information criteria.</p>
<p>P.S. <a href="/2024/03/21/what-s-wrong-with-arima/">See also my early post on ARIMA</a>, discussing what is wrong with it.</p>
<p>Message <a href="https://openforecast.org/2025/05/13/fundamental-flaw-of-the-box-jenkins-methodology/">Fundamental Flaw of the Box-Jenkins Methodology</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2025/05/13/fundamental-flaw-of-the-box-jenkins-methodology/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Detecting patterns in white noise</title>
		<link>https://openforecast.org/2024/04/10/detecting-patterns-in-white-noise/</link>
					<comments>https://openforecast.org/2024/04/10/detecting-patterns-in-white-noise/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Wed, 10 Apr 2024 08:16:58 +0000</pubDate>
				<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Social media]]></category>
		<category><![CDATA[ADAM]]></category>
		<category><![CDATA[smooth]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=3413</guid>

					<description><![CDATA[<p>Back in 2015, when I was working on my paper on Complex Exponential Smoothing, I conducted a simple simulation experiment to check how ARIMA and ETS select components/orders in time series. And I found something interesting&#8230; One of the important steps in forecasting with statistical models is identifying the existing structure. In the case of [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2024/04/10/detecting-patterns-in-white-noise/">Detecting patterns in white noise</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Back in 2015, when I was working on my paper on <a href="/2022/08/02/complex-exponential-smoothing/">Complex Exponential Smoothing</a>, I conducted a simple simulation experiment to check how ARIMA and ETS select components/orders in time series. And I found something interesting&#8230;</p>
<p>One of the important steps in forecasting with statistical models is identifying the existing structure. In the case of ETS, it comes to selecting trend/seasonal components, while for ARIMA, it&#8217;s about order selection. In R, several functions automatically handle this based on information criteria (<a href="https://doi.org/10.18637/jss.v027.i03">Hyndman &#038; Khandakar, 2006</a>; <a href="https://doi.org/10.1080/00207543.2019.1600764">Svetunkov &#038; Boylan (2017)</a>; <a href="https://openforecast.org/adam/ADAMSelection.html">Chapter 15 of ADAM</a>). I decided to investigate how this mechanism works.</p>
<p>I generated data from the Normal distribution with a fixed mean of 5000 and a standard deviation of 50. Then, I asked ETS and ARIMA (from the forecast package in R) to automatically select the appropriate model for each of 1000 time series. Here is the R code for this simple experiment:</p>
<div class="su-accordion su-u-trim"><div class="su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>Some R code</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode"># Set random seed for reproducibility
set.seed(41, kind="L'Ecuyer-CMRG")
# Number of iterations
nsim <- 1000
# Number of observations
obsAll <- 120
# Generate data from N(5000, 50)
rnorm(nsim*obsAll, 5000, 50) |>
  matrix(obsAll, nsim) |>
  ts(frequency=12) -> x

# Load forecast package
library(forecast)
# Load doMC for parallel calculations
# doMC is only available on Linux and Max
# Use library(doParallel) on Windows
library(doMC)
registerDoMC(detectCores())

# A loop for ARIMA, recording the orders
matArima <- foreach(i=1:nsim, .combine=cbind, .packages=c("forecast")) %dopar% {
    testModel <- auto.arima(x&#091;,i&#093;)
    # The element number 5 is just m, period of seasonality
    return(c(testModel$arma&#091;-5&#093;,(!is.na(testModel$coef&#091;"drift"&#093;))*1))
}
rownames(matArima) <- c("AR","MA","SAR","SMA","I","SI","Drift")

# A loop for ETS, recording the model types
matEts <- foreach(i=1:nsim, .combine=cbind, .packages=c("forecast")) %dopar% {
    testModel <- ets(x&#091;,i&#093;, allow.multiplicative.trend=TRUE)
    return(testModel&#091;13&#093;$method)
}
</pre>
</div></div></div>
<p>The findings of this experiment are summarised using the following chunk of the R code:</p>
<div class="su-accordion su-u-trim"><div class="su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>R code for the analysis of the results</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode">
#### Auto ARIMA ####
# Non-seasonal ARIMA elements
mean(apply(matArima[c("AR","MA","I","Drift"),]!=0, 2, any))
# Seasonal ARIMA elements
mean(apply(matArima[c("SAR","SMA","SI"),]!=0, 2, any))

#### ETS ####
# Trend in ETS
mean(substr(matEts,7,7)!="N")
# Seasonality in ETS
mean(substr(matEts,nchar(matEts)-1,nchar(matEts)-1)!="N")</pre>
</div></div></div>
<p>I summarised them in the following table:</p>
<table>
<thead>
<tr>
<td></td>
<td><strong>ARIMA</strong></td>
<td><strong>ETS</strong></td>
</tr>
</thead>
<tr>
<td>Non-seasonal elements</td>
<td>24.8%</td>
<td>2.3%</td>
</tr>
<tr>
<td>Seasonal elements</td>
<td>18.0%</td>
<td>0.2%</td>
</tr>
<tr>
<td>Any type of structure</td>
<td>37.9%</td>
<td>2.4%</td>
</tr>
</table>
<p>So, ARIMA detected some structure (had non-zero orders) in almost 40% of all time series, even though the data was designed to have no structure (just white noise). It also captured non-seasonal orders in a quarter of the series and identified seasonality in 18% of them. ETS performed better (only 0.2% of seasonal models identified on the white noise), but still captured trends in 2.3% of cases.</p>
<p>Does this simple experiment suggest that ARIMA is a bad model and ETS is a good one? No, it does not. It simply demonstrates that ARIMA tends to overfit the data if allowed to select whatever it wants. How can we fix that?</p>
<p>My solution: restrict the pool of ARIMA models to check, preventing it from going crazy. My personal pool includes ARIMA(0,1,1), (1,1,2), (0,2,2), along with the seasonal orders of (0,1,1), (1,1,2), and (0,2,2), and combinations between them. This approach is motivated by the connection between <a href="https://openforecast.org/adam/ARIMAandETS.html">ARIMA and ETS</a>. Additionally, we can check whether the addition of AR/MA orders detected by ACF/PACF analysis of the best model reduces the AICc. If not, they shouldn't be included.</p>
<p>This algorithm can be written in the following simple function that uses <code>msarima()</code> function from the smooth package in R (note that the reason why this function is used is because all ARIMA models implemented in the function are directly comparable via information criteria):</p>
<div class="su-accordion su-u-trim"><div class="su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>R code for the compact ARIMA function</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode">arimaCompact <- function(y, lags=c(1,frequency(y)), ic=c("AICc","AIC","BIC","BICc"), ...){

    # Start measuring the time of calculations
    startTime <- Sys.time();

    # If there are no lags for the basic components, correct this.
    if(sum(lags==1)==0){
        lags <- c(1,lags);
    }

    orderLength <- length(lags);
    ic <- match.arg(ic);
    IC <- switch(ic,
                 "AIC"=AIC,
                 "AICc"=AICc,
                 "BIC"=BIC,
                 "BICc"=BICc);

    # We consider the following list of models:
    # ARIMA(0,1,1), (1,1,2), (0,2,2),
    # ARIMA(0,0,0)+c, ARIMA(0,1,1)+c,
    # seasonal orders (0,1,1), (1,1,2), (0,2,2)
    # And all combinations between seasonal and non-seasonal parts
    # 
    # Encode all non-seasonal parts
    nNonSeasonal <- 5
    arimaNonSeasonal <- matrix(c(0,1,1,0, 1,1,2,0, 0,2,2,0, 0,0,0,1, 0,1,1,1), nNonSeasonal,4,
                               dimnames=list(NULL, c("ar","i","ma","const")), byrow=TRUE)
    # Encode all seasonal parts ()
    nSeasonal <- 4
    arimaSeasonal <- matrix(c(0,0,0, 0,1,1, 1,1,2, 0,2,2), nSeasonal,3,
                               dimnames=list(NULL, c("sar","si","sma")), byrow=TRUE)

    # Check all the models in the pool
    testModels <- vector("list", nSeasonal*nNonSeasonal);
    m <- 1;
    for(i in 1:nSeasonal){
        for(j in 1:nNonSeasonal){
            testModels&#091;&#091;m&#093;&#093; <- msarima(y, orders=list(ar=c(arimaNonSeasonal&#091;j,1&#093;,arimaSeasonal&#091;i,1&#093;),
                                                      i=c(arimaNonSeasonal&#091;j,2&#093;,arimaSeasonal&#091;i,2&#093;),
                                                      ma=c(arimaNonSeasonal&#091;j,3&#093;,arimaSeasonal&#091;i,3&#093;)),
                                       constant=arimaNonSeasonal&#091;j,4&#093;==1, lags=lags, ...);
            m&#091;&#093; <- m+1;
        }
    }

    # Find the best one
    m <- which.min(sapply(testModels, IC));
    # Amend computational time
    testModels&#091;&#091;m&#093;&#093;$timeElapsed <- Sys.time()-startTime;

    return(testModels&#091;&#091;m&#093;&#093;);
}</pre>
</div></div></div>
<p>Additionally, we can check whether the addition of AR/MA orders detected by ACF/PACF analysis of the best model reduces the AICc. If not, they shouldn't be included. I have not added that part in the code above. Still, this algorithm brings some improvements:</p>
<div class="su-accordion su-u-trim"><div class="su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>R code for the application of compact ARIMA to the data</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode">#### Load the smooth package
library(smooth)

# A loop for the compact ARIMA, recording the orders
matArimaCompact <- foreach(i=1:nsim, .packages=c("smooth")) %dopar% {
    testModel <- arimaCompact(x&#091;,i&#093;)
    return(orders(testModel))
}

#### Auto MSARIMA from smooth ####
# Non-seasonal ARIMA elements
mean(sapply(sapply(matArimaCompact, "&#091;&#091;", "ar"), function(x){x&#091;1&#093;!=0}) |
  sapply(sapply(matArimaCompact, "&#091;&#091;", "i"), function(x){x&#091;1&#093;!=0}) |
  sapply(sapply(matArimaCompact, "&#091;&#091;", "ma"), function(x){x&#091;1&#093;!=0}))

# Seasonal ARIMA elements
mean(sapply(sapply(matArimaSmooth, "&#091;&#091;", "ar"), function(x){length(x)==2 &#038;&#038; (x&#091;2&#093;!=0)}) |
  sapply(sapply(matArimaSmooth, "&#091;&#091;", "i"), function(x){length(x)==2 &#038;&#038; (x&#091;2&#093;!=0)}) |
  sapply(sapply(matArimaSmooth, "&#091;&#091;", "ma"), function(x){length(x)==2 &#038;&#038; (x&#091;2&#093;!=0)}))
</pre>
</div></div></div>
<p>In my case, it resulted in the following:</p>
<table>
<thead>
<tr>
<td></td>
<td><strong>ARIMA</strong></td>
<td><strong>ETS</strong></td>
<td style="text-align: center"><strong>Compact ARIMA</strong></td>
</tr>
</thead>
<tr>
<td>Non-seasonal elements</td>
<td>24.8%</td>
<td>2.3%</td>
<td style="text-align: center">2.4%</td>
</tr>
<tr>
<td>Seasonal elements</td>
<td>18.0%</td>
<td>0.2%</td>
<td style="text-align: center">0.0%</td>
</tr>
<tr>
<td>Any type of structure</td>
<td>37.9%</td>
<td>2.4%</td>
<td style="text-align: center">2.4%</td>
</tr>
</table>
<p>As we see, when we impose restrictions on order selection in ARIMA, it avoids fitting seasonal models to non-seasonal data. While it still makes minor mistakes in terms of non-seasonal structure, it's nothing compared to the conventional approach. What about accuracy? I don't know. I'll have to write another post on this :).</p>
<p>Note that the models were applied to samples of 120 observations, which is considered "small" in statistics, while in real life is sometimes a luxury to have...</p>
<p>Message <a href="https://openforecast.org/2024/04/10/detecting-patterns-in-white-noise/">Detecting patterns in white noise</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2024/04/10/detecting-patterns-in-white-noise/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What&#8217;s wrong with ARIMA?</title>
		<link>https://openforecast.org/2024/03/21/what-s-wrong-with-arima/</link>
					<comments>https://openforecast.org/2024/03/21/what-s-wrong-with-arima/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Thu, 21 Mar 2024 10:10:52 +0000</pubDate>
				<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[Social media]]></category>
		<category><![CDATA[Univariate models]]></category>
		<category><![CDATA[extrapolation methods]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=3366</guid>

					<description><![CDATA[<p>Have you heard of ARIMA? It is one of the benchmark forecasting models used in different academic experiments, although it is not always popular among practitioners. But why? What&#8217;s wrong with ARIMA? ARIMA has been a standard forecasting model in statistics for ages. It gained popularity with the famous Box &#038; Jenkins (1970) book and [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2024/03/21/what-s-wrong-with-arima/">What&#8217;s wrong with ARIMA?</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Have you heard of ARIMA? It is one of the benchmark forecasting models used in different academic experiments, although it is not always popular among practitioners. But why? What&#8217;s wrong with ARIMA?</p>
<p>ARIMA has been a standard forecasting model in statistics for ages. It gained popularity with the famous <a href="https://archive.org/details/timeseriesanalys0000boxg">Box &#038; Jenkins (1970) book</a> and was considered the best forecasting model by statisticians for a couple of decades without any strong evidence to support this.</p>
<p>It represents one of the two fundamental approaches to time series modeling (the second being the state space approach): <a href="https://openforecast.org/adam/ARIMA.html">it captures the relation between the variable and itself in the past</a>. This has a great rationale in technical areas. For example, the quantity of CO2 in a furnace at this moment in time will depend on the quantity of CO2 five minutes ago. Such processes can be efficiently modeled and then forecasted using ARIMA. In demand forecasting, making sense of ARIMA is more challenging: it is hard to argue that the demand for shoes on Monday can impact the demand on Tuesday. So, when we apply ARIMA to such data, we sort of rely on a spurious relation. Still, demand data often exhibits autocorrelations, and ARIMA has been used efficiently in that context.</p>
<p>Over the years, ARIMA did not perform well in different competitions (see <a href="/2024/03/14/the-role-of-m-competitions-in-forecasting/">my post</a> about that), but this was mainly due to the wrong assumptions in <a href="https://openforecast.org/adam/BJApproach.html#BJApproachSummary">Box-Jenkins methodology</a>, not because the model has been fundamentally bad. After <a href="https://doi.org/10.18637/jss.v027.i03">Hyndman &#038; Khandakar (2006)</a> implemented their version with automatic order selection based on information criteria, ARIMA has started producing much more accurate forecasts.</p>
<p>But if I were to summarize what the problem with the model is, I would outline these points:</p>
<ol>
<li>It is hard to explain ARIMA to people who are not comfortable with statistics. Here is an example of how seasonal ARIMA(1,0,1)(1,0,1)_4 is written mathematically:<br />
\begin{equation*}<br />
  y_t (1 -\phi_{4,1} B^4)(1 -\phi_{1} B) = \epsilon_t (1 + \theta_{4,1} B^4) (1 + \theta_{1} B).<br />
\end{equation*}<br />
Good luck explaining this to a demand planner who does not know mathematics.</li>
<li>It is hard to estimate, especially for models with seasonality. It is typically estimated using some numeric optimisation, and reaching the maximum likelihood (or a global minimum of a loss function) is not guaranteed.</li>
<li>It is hard to select the appropriate order of the model, as there can be thousands of potential models to choose from. Yes, there are heuristic approaches that allow simplifying the problem and selecting a reasonable model (e.g. <a href="https://doi.org/10.18637/jss.v027.i03">Hyndman &#038; Khandakar, 2006</a>; or <a href="https://doi.org/10.1080/00207543.2019.1600764">Svetunkov &#038; Boylan, 2017</a>), but they do not guarantee that you will get the best possible model.</li>
</ol>
<p>Nonetheless, ARIMA is a strong contender that can outperform other models if implemented well. Furthermore, it has become one of the standard forecasting benchmarks in forecasting-related experiments. So, if you are a data scientist comfortable with mathematics and want to see how your machine learning approach performs, you should consider including ARIMA as a benchmark.</p>
<p>P.S. Check out <a href="https://www.linkedin.com/posts/vandeputnicolas_i-am-not-aware-of-any-successful-use-at-activity-7148632910441377793-27s5">a post by Nicolas Vandeput on LinkedIn</a> &#8211; he had a discussion about ARIMA and raised good points as well.</p>
<p>Message <a href="https://openforecast.org/2024/03/21/what-s-wrong-with-arima/">What&#8217;s wrong with ARIMA?</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2024/03/21/what-s-wrong-with-arima/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Multi-step Estimators and Shrinkage Effect in Time Series Models</title>
		<link>https://openforecast.org/2023/08/09/multi-step-estimators-and-shrinkage-effect-in-time-series-models/</link>
					<comments>https://openforecast.org/2023/08/09/multi-step-estimators-and-shrinkage-effect-in-time-series-models/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Wed, 09 Aug 2023 10:14:59 +0000</pubDate>
				<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[Package smooth for R]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Univariate models]]></category>
		<category><![CDATA[extrapolation methods]]></category>
		<category><![CDATA[papers]]></category>
		<category><![CDATA[theory]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=3142</guid>

					<description><![CDATA[<p>Authors: Ivan Svetunkov, Nikos Kourentzes, Rebecca Killick Journal: Computational Statistics Abstract: Many modern statistical models are used for both insight and prediction when applied to data. When models are used for prediction one should optimise parameters through a prediction error loss function. Estimation methods based on multiple steps ahead forecast errors have been shown to [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2023/08/09/multi-step-estimators-and-shrinkage-effect-in-time-series-models/">Multi-step Estimators and Shrinkage Effect in Time Series Models</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Authors</strong>: Ivan Svetunkov, <a href="http://kourentzes.com/forecasting/">Nikos Kourentzes</a>, <a href="https://www.lancaster.ac.uk/maths/people/rebecca-killick">Rebecca Killick</a></p>
<p><strong>Journal</strong>: <a href="https://www.springer.com/journal/180">Computational Statistics</a></p>
<p><strong>Abstract</strong>: Many modern statistical models are used for both insight and prediction when applied to data. When models are used for prediction one should optimise parameters through a prediction error loss function. Estimation methods based on multiple steps ahead forecast errors have been shown to lead to more robust and less biased estimates of parameters. However, a plausible explanation of why this is the case is lacking. In this paper, we provide this explanation, showing that the main benefit of these estimators is in a shrinkage effect, happening in univariate models naturally. However, this can introduce a series of limitations, due to overly aggressive shrinkage. We discuss the predictive likelihoods related to the multistep estimators and demonstrate what their usage implies to time series models. To overcome the limitations of the existing multiple steps estimators, we propose the Geometric Trace Mean Squared Error, demonstrating its advantages. We conduct a simulation experiment showing how the estimators behave with different sample sizes and forecast horizons. Finally, we carry out an empirical evaluation on real data, demonstrating the performance and advantages of the estimators. Given that the underlying process to be modelled is often unknown, we conclude that the shrinkage achieved by the GTMSE is a competitive alternative to conventional ones.</p>
<p><strong>DOI</strong>: <a href="https://doi.org/10.1007/s00180-023-01377-x">10.1007/s00180-023-01377-x</a>.</p>
<p><a href="http://dx.doi.org/10.13140/RG.2.2.17854.31043">Working paper</a>.</p>
<h2>About the paper</h2>
<p><b>DISCLAIMER 1</b>: To better understand what I am talking about in this section, I would recommend you to have a look at the <a href="https://openforecast.org/adam/">ADAM monograph</a>, and specifically at <a href="https://openforecast.org/adam/ADAMETSEstimation.html">the Chapter 11</a>. In fact, <a href="https://openforecast.org/adam/multistepLosses.html">Section 11.3</a> is based on this paper.</p>
<p><b>DISCLAIMER 2</b>: All the discussions in the paper only apply to pure additive models. If you are interested in multiplicative or mixed ETS models, you&#8217;ll have to wait another seven years for another paper on this topic to get written and published.</p>
<h3>Introduction</h3>
<p>There are lots of ways how dynamic models can be estimated. Some analysts prefer likelihood, some would stick with Least Squares (i.e. minimising MSE), while others would use advanced estimators like Huber&#8217;s loss or M-estimators. And sometimes, statisticians or machine learning experts would use multiple steps ahead estimators. For example, they would use a so-called &#8220;direct forecast&#8221; by fitting a model to the data, producing h-steps ahead in-sample point forecasts from the very first to the very last observation, then calculating the respective h-steps ahead forecast errors and (based on them) Mean Squared Error. Mathematically, this can be written as:</p>
<p>\begin{equation} \label{eq:hstepsMSE}<br />
	\mathrm{MSE}_h = \frac{1}{T-h} \sum_{t=1}^{T-h} e_{t+h|t}^2 ,<br />
\end{equation}<br />
where \(e_{t+h|t}\) is the h-steps ahead error for the point forecast produced from the observation \(t\), and \(T\) is the sample size.</p>
<p>In my final year of PhD, I have decided to analyse how different multistep loss functions work, to understand what happens with dynamic models, when these losses are minimised, and how this can help in efficient model estimation. Doing the literature review, I noticed that the claims about the multistep estimators are sometimes contradictory: some authors say that they are more efficient (i.e. estimates of parameters have lower variances) than the conventional estimators, some say that they are less efficient; some claim that they improve accuracy, while the others do not find any substantial improvements. Finally, I could not find a proper explanation of what happens with the dynamic models when the estimators are used. So, I&#8217;ve started my own investigation, together with Nikos Kourentzes and Rebecca Killick (who was my internal examiner and joined our team after my graduation).</p>
<p>Our investigation started with the single source of error model, then led us to predictive likelihoods and, after that &#8211; to the development of a couple of non-conventional estimators. As a result, the paper grew and became less focused than initially intended. In the end, it became 42 pages long and discussed several aspects of models estimation (making it a bit of a hodgepodge):</p>
<ol>
<li>How multistep estimators regularise parameters of dynamic models;</li>
<li>That multistep forecast errors are always correlated when the models&#8217; parameters are not zero;</li>
<li>What predictive likelihoods align with the multistep estimators (this is useful for a discussion of their statistical properties);</li>
<li>How General Predictive Likelihood encompasses all popular multistep estimators;</li>
<li>And that there is another estimator (namely GTMSE &#8211; Geometric Trace Mean Squared Error), which has good properties and has not been discussed in the literature before.</li>
</ol>
<p>Because of the size of the paper and the spread of the topics throughout it, many reviewers ignored (1) &#8211; (4), focusing on (5) and thus rejecting the paper on the grounds that we propose a new estimator, but instead spend too much time discussing irrelevant topics. These types of comments were given to us by the editor of the Journal of the Royal Statistical Society: B and reviewers of Computational Statistics and Data Analysis. While we tried addressing this issue several times, given the size of the paper, we failed to fix it fully. The paper was rejected from both of these journals and ended up in Computational Statistics, where the editor gave us a chance to respond to the comments. We explained what the paper was really about and changed its focus to satisfy the reviewers, after which the paper was accepted.</p>
<p>So, what are the main findings of this paper?</p>
<h3>How multistep estimators regularise parameters of dynamic models</h3>
<p>Given that any dynamic model (such as ETS or ARIMA) can be represented in the Single Source of Error state space form, we showed that the application of multistep estimators leads to the inclusion of parameters of models in the loss function, leading to the regularisation. In ETS, this means that the smoothing parameters are shrunk to zero, with the shrinkage becoming stronger with the increase of the forecasting horizon relative to the sample size. This makes the models less stochastic and more conservative. Mathematically this becomes apparent if we express the conditional multistep variance in terms of smoothing parameters and one-step-ahead error variance. For example, for ETS(A,N,N) we have:</p>
<p>\begin{equation} \label{eq:hstepsMSEVariance}<br />
	\mathrm{MSE}_h \propto \hat{\sigma}_1^2 \left(1 +(h-1) \hat{\alpha} \right),<br />
\end{equation}<br />
where \( \hat{\alpha} \) is the smoothing parameter and \(\hat{\sigma}_1^2 \) is the one-step-ahead error variance. From the formula \eqref{eq:hstepsMSEVariance}, it becomes apparent that when we minimise MSE\(_h\), the estimated variance and the smoothing parameters will be minimised as well. This is how the shrinkage effect appears: we force \( \hat{\alpha} \) to become as close to zero as possible, and the strength of shrinkage is regulated by the forecasting horizon \( h \).</p>
<p>In the paper itself, we discuss this effect for several multistep estimators (the specific effect would be different between them) and several ETS and ARIMA models. While for ETS, it is easy to show how shrinkage works, for ARIMA, the situation is more complicated because the direction of shrinkage would change with the ARIMA orders. Still, what can be said clearly for any dynamic model is that the multistep estimators make them less stochastic and more conservative.</p>
<h3>Multistep forecast errors are always correlated</h3>
<p>This is a small finding, done in bypassing. It means that, for example, the forecast error two steps ahead is always correlated with the three steps ahead one. This does not depend on the autocorrelation of residuals or any violation of assumptions of the model but rather only on whether the parameters of the model are zero or not. This effect arises from the model rather than from the data. The only situation when the forecast errors will not be correlated is when the model is deterministic (e.g. linear trend). This has important practical implications because some forecasting techniques make explicit and unrealistic assumptions that these correlations are zero, which would impact the final forecasts.</p>
<h3>Predictive likelihoods aligning with the multistep estimators</h3>
<p>We showed that if a model assumes the Normal distribution, in the case of MSEh and MSCE (Mean Squared Cumulative Error), the distribution of the future values follows Normal as well. This means that there are predictive likelihood functions for these models, the maximum of which is achieved with the same set of parameters as the minimum of the multistep estimators. This has two implications:</p>
<ol>
<li>These multistep estimators should be consistent and efficient, especially when the smoothing parameters are close to zero;</li>
<li>The predictive likelihoods can be used in the model selection via information criteria.</li>
</ol>
<p>The first point also explains the contradiction in the literature: if the smoothing parameter in the population is close to zero, then the multistep estimators will give more efficient estimates than the conventional estimators; in the other case, it might be less efficient. We have not used the second point above, but it would be useful when the best model needs to be selected for the data, and an analyst wants to use information criteria. This is one of the potential ways for future research.</p>
<h3>How General Predictive Likelihood (GPL) encompasses all popular multistep estimators</h3>
<p>GPL arises when the joint distribution of 1 to h steps ahead forecast errors is considered. It will be Multivariate Normal if the model assumes normality. In the paper, we showed that the maximum of GPL coincides with the minimum of the so-called &#8220;Generalised Variance&#8221; &#8211; the determinant of the covariance matrix of forecast errors. This minimisation reduces variances for all the forecast errors (from 1 to h) and increases the covariances between them, making the multistep forecast errors look more similar. In the perfect case, when the model is correctly specified (no omitted or redundant variables, homoscedastic residuals etc), the maximum of GPL will coincide with the maximum of the conventional likelihood of the Normal distribution (see <a href="https://openforecast.org/adam/ADAMETSEstimationLikelihood.html">Section 11.1 of the ADAM monograph</a>).</p>
<p>Accidentally, it can be shown that the existing estimators are just special cases of the GPL, but with some restrictions on the covariance matrix. I do not intend to show it here, the reader is encouraged to either read the paper or see the brief discussion <a href="https://openforecast.org/adam/multistepLosses.html#multistepLossesGPL">in Subsection 11.3.5</a> of the ADAM monograph.</p>
<h3>GTMSE &#8211; Geometric Trace Mean Squared Error</h3>
<p>Finally, looking at the special cases of GPL, we have noticed that there is one which has not been discussed in the literature. We called it Geometric Trace Mean Squared Error (GTMSE) because of the logarithms in the formula:<br />
\begin{equation} \label{eq:GTMSE}<br />
	\mathrm{GTMSE} = \sum_{j=1}^h \log \frac{1}{T-j} \sum_{t=1}^{T-j} e_{t+j|t}^2 .<br />
\end{equation}<br />
GTMSE imposes shrinkage on parameters similar to other estimators but does it more mildly because of the logarithms in the formula. In fact, what the logarithms do is make variances of all forecast errors similar to each other. As a result, when used, GTMSE does not focus on the larger variances as other methods do but minimises all of them simultaneously similarly.</p>
<h2>Examples in R</h2>
<p>The estimators discussed in the paper are all implemented in the functions of the smooth package in R, including <code>adam()</code>, <code>es()</code>, <code>ssarima()</code>, <code>msarima()</code> and <code>ces()</code>. In the example below, we will see how the shrinkage works for the ETS on the example of Box-Jenkins sales data (this is the example taken from ADAM, <a href="https://openforecast.org/adam/multistepLosses.html#an-example-in-r-2">Subsection 11.3.7</a>):</p>
<pre class="decode">library(smooth)

adamETSAANBJ <- vector("list",6)
names(adamETSAANBJ) <- c("MSE","MSEh","TMSE","GTMSE","MSCE","GPL")
for(i in 1:length(adamETSAANBJ)){
    adamETSAANBJ[[i]] <- adam(BJsales, "AAN", h=10, holdout=TRUE,
                              loss=names(adamETSAANBJ)[i])
}</pre>
<p>The ETS(A,A,N) model, applied to this data, has different estimates of smoothing parameters:</p>
<pre class="decode">sapply(adamETSAANBJ,"[[","persistence") |>
	round(5)</pre>
<pre>          MSE MSEh TMSE   GTMSE MSCE GPL
alpha 1.00000    1    1 1.00000    1   1
beta  0.23915    0    0 0.14617    0   0</pre>
<p>We can see how shrinkage shows itself in the case of the smoothing parameter \(\beta\), which is shrunk to zero by MSEh, TMSE, MSCE and GPL but left intact by MSE and shrunk a little bit in the case of GTMSE. These different estimates of parameters lead to different forecasting trajectories and prediction intervals, as can be shown visually:</p>
<pre class="decode">par(mfcol=c(3,2), mar=c(2,2,4,1))
# Produce forecasts
lapply(adamETSAANBJ, forecast, h=10, interval="prediction") |>
# Plot forecasts
    lapply(function(x, ...) plot(x, ylim=c(200,280), main=x$model$loss))</pre>
<p>This should result in the following plots:</p>
<div id="attachment_3162" style="width: 1210px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses.png&amp;nocache=1"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-3162" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses.png&amp;nocache=1" alt="ADAM ETS on Box-Jenkins data with several estimators" width="1200" height="700" class="size-full wp-image-3162" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses.png&amp;nocache=1 1200w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/07/ADAMBJSalesLosses-768x448.png&amp;nocache=1 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></a><p id="caption-attachment-3162" class="wp-caption-text">ADAM ETS on Box-Jenkins data with several estimators</p></div>
<p>Analysing the figure, it looks like the shrinkage of the smoothing parameter \(\beta\) is useful for this time series: the forecasts from ETS(A,A,N) estimated using MSEh, TMSE, MSCE and GPL look closer to the actual values than the ones from MSE and GTMSE. To assess their performance more precisely, we can extract error measures from the models:</p>
<pre class="decode">sapply(adamETSAANBJ,"[[","accuracy") |>
	round(5)[c("ME","MSE"),]</pre>
<pre>         MSE    MSEh    TMSE    GTMSE    MSCE     GPL
ME   3.22900 1.06479 1.05233  3.44962 1.04604 0.95515
MSE 14.41862 2.89067 2.85880 16.26344 2.84288 2.62394</pre>
<p>Alternatively, we can calculate error measures based on the produced forecasts and the <code>measures()</code> function from the <code>greybox</code> package:</p>
<pre class="decode">lapply(adamETSAANBJ, forecast, h=10) |>
    sapply(function(x, ...) measures(holdout=x$model$holdout,
                                     forecast=x$mean,
                                     actual=actuals(x$model)))</pre>
<p>A thing to note about the multistep estimators is that they are slower than the conventional ones because they require producing 1 to \( h \) steps ahead forecasts from every observation in-sample. In the case of the <code>smooth</code> functions, the time elapsed can be extracted from the models in the following way:</p>
<pre class="decode">sapply(adamETSAANBJ, "[[", "timeElapsed")</pre>
<p>In summary, the multistep estimators are potentially useful in forecasting and can produce models with more accurate forecasts. This happens because they impose shrinkage on the estimates of parameters, making models less stochastic and more inert. But their performance depends on each specific situation and the available data, so I would not recommend using them universally.</p>
<p>Message <a href="https://openforecast.org/2023/08/09/multi-step-estimators-and-shrinkage-effect-in-time-series-models/">Multi-step Estimators and Shrinkage Effect in Time Series Models</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2023/08/09/multi-step-estimators-and-shrinkage-effect-in-time-series-models/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>smooth v3.2.0: what&#8217;s new?</title>
		<link>https://openforecast.org/2023/01/30/smooth-v3-2-0-what-s-new/</link>
					<comments>https://openforecast.org/2023/01/30/smooth-v3-2-0-what-s-new/#comments</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 13:06:47 +0000</pubDate>
				<category><![CDATA[About es() function]]></category>
		<category><![CDATA[adam()]]></category>
		<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[Package smooth for R]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Regression]]></category>
		<category><![CDATA[Univariate models]]></category>
		<category><![CDATA[ADAM]]></category>
		<category><![CDATA[smooth]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=3063</guid>

					<description><![CDATA[<p>smooth package has reached version 3.2.0 and is now on CRAN. While the version change from 3.1.7 to 3.2.0 looks small, this has introduced several substantial changes and represents a first step in moving to the new C++ code in the core of the functions. In this short post, I will outline the main new [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2023/01/30/smooth-v3-2-0-what-s-new/">smooth v3.2.0: what&#8217;s new?</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>smooth package has reached version 3.2.0 and is now <a href="https://cran.r-project.org/package=smooth">on CRAN</a>. While the version change from 3.1.7 to 3.2.0 looks small, this has introduced several substantial changes and represents a first step in moving to the new C++ code in the core of the functions. In this short post, I will outline the main new features of smooth 3.2.0.</p>
<p><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2.png&amp;nocache=1"><img decoding="async" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2-300x218.png&amp;nocache=1" alt="" width="300" height="218" class="aligncenter size-medium wp-image-3065" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2-300x218.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2-1024x745.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2-768x559.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2-1536x1117.png&amp;nocache=1 1536w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/smooth2.png&amp;nocache=1 1650w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<h3>New engines for ETS, MSARIMA and SMA</h3>
<p>The first and one of the most important changes is the new engine for the ETS (Error-Trend-Seasonal exponential smoothing model), MSARIMA (Multiple Seasonal ARIMA) and SMA (Simple Moving Average), implemented respectively in <code>es()</code>, <code>msarima()</code> and <code>sma()</code> functions. The new engine was developed for <code>adam()</code> and the three models above can be considered as special cases of it. You can read more about ETS in ADAM monograph, starting from<a href="https://openforecast.org/adam/ETSConventional.html"> Chapter 4</a>; MSARIMA is discussed in <a href="https://openforecast.org/adam/ADAMARIMA.html">Chapter 9</a>, while SMA is briefly discussed in <a href="https://openforecast.org/adam/simpleForecastingMethods.html#SMA">Subsection 3.3.3</a>.</p>
<p>The <code>es()</code> function now implements the ETS close to the conventional one, assuming that the error term follows normal distribution. It still supports explanatory variables (discussed in <a href="https://openforecast.org/adam/ADAMX.html">Chapter 10 of ADAM monograph</a>) and advanced estimators (<a href="https://openforecast.org/adam/ADAMETSEstimation.html">Chapter 11</a>), and it has the same syntax as the previous version of the function had, but now acts as a wrapper for <code>adam()</code>. This means that it is now faster, more accurate and requires less memory than it used to. <code>msarima()</code> being a wrapper of <code>adam()</code> as well, is now also faster and more accurate than it used to be. But in addition to that both functions now support the methods that were developed for <code>adam()</code>, including <code>vcov()</code>, <code>confint()</code>, <code>summary()</code>, <code>rmultistep()</code>, <code>reapply()</code>, <code>plot()</code> and others. So, now you can do more thorough analysis and improve the models using all these advanced instruments (see, for example, <a href="https://openforecast.org/adam/diagnostics.html">Chapter 14 of ADAM</a>).</p>
<p>The main reason why I moved the functions to the new engine was to clean up the code and remove the old chunks that were developed when I only started learning C++. A side effect, as you see, is that the functions have now been improved in a variety of ways.</p>
<p>And to be on the safe side, the old versions of the functions are still available in <code>smooth</code> under the names <code>es_old()</code>, <code>msarima_old()</code> and <code>sma_old()</code>. They will be removed from the package if it ever reaches the v.4.0.0.</p>
<h3>New methods for ADAM</h3>
<p>There are two new methods for <code>adam()</code> that can be used in a variety of cases. The first one is <code>simulate()</code>, which will generate data based on the estimated ADAM, whatever the original model is (e.g. mixture of ETS, ARIMA and regression on the data with multiple frequencies). Here is how it can be used:</p>
<pre class="decode">adam(BJsales, "AAdN") |>
     simulate() |>
     plot()</pre>
<p>which will produce a plot similar to the following:</p>
<div id="attachment_3077" style="width: 650px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate.png&amp;nocache=1"><img decoding="async" aria-describedby="caption-attachment-3077" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate-1024x597.png&amp;nocache=1" alt="Simulated data based on adam() applied to Box-Jenkins sales data" width="640" height="373" class="size-large wp-image-3077" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate-768x448.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamSimulate.png&amp;nocache=1 1200w" sizes="(max-width: 640px) 100vw, 640px" /></a><p id="caption-attachment-3077" class="wp-caption-text">Simulated data based on adam() applied to Box-Jenkins sales data</p></div>
<p>This can be used for research, when a more controlled environment is needed. If you want to fine tune the parameters of ADAM before simulating the data, you can save the output in an object and amend its parameters. For example:</p>
<pre class="decode">testModel <- adam(BJsales, "AAdN")
testModel$persistence <- c(0.5, 0.2)
simulate(testModel)</pre>
<p>The second new method is the <code>xtable()</code> from the respective <code>xtable</code> package. It produces LaTeX version of the table from the summary of ADAM. Here is an example of a summary from ADAM ETS:</p>
<pre class="decode">adam(BJsales, "AAdN") |>
     summary()</pre>
<pre>Model estimated using adam() function: ETS(AAdN)
Response variable: BJsales
Distribution used in the estimation: Normal
Loss function type: likelihood; Loss function value: 256.1516
Coefficients:
      Estimate Std. Error Lower 2.5% Upper 97.5%  
alpha   0.9514     0.1292     0.6960      1.0000 *
beta    0.3328     0.2040     0.0000      0.7358  
phi     0.8560     0.1671     0.5258      1.0000 *
level 203.2835     5.9968   191.4304    215.1289 *
trend  -2.6793     4.7705   -12.1084      6.7437  

Error standard deviation: 1.3623
Sample size: 150
Number of estimated parameters: 6
Number of degrees of freedom: 144
Information criteria:
     AIC     AICc      BIC     BICc 
524.3032 524.8907 542.3670 543.8387</pre>
<p>As you can see in the output above, the function generates the confidence intervals for the parameters of the model, including the smoothing parameters, dampening parameter and the initial states. This summary can then be used to generate the LaTeX code for the main part of the table:</p>
<pre class="decode">adam(BJsales, "AAdN") |>
     xtable()</pre>
<p>which will looks something like this:</p>
<div id="attachment_3073" style="width: 650px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable.png&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3073" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable-1024x303.png&amp;nocache=1" alt="Summary of adam()" width="512" height="152" class="size-large wp-image-3073" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable-1024x303.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable-300x89.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable-768x227.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2023/01/adamXtable.png&amp;nocache=1 1207w" sizes="auto, (max-width: 512px) 100vw, 512px" /></a><p id="caption-attachment-3073" class="wp-caption-text">Summary of adam()</p></div>
<h3>Other improvements</h3>
<p>First, one of the major changes in <code>smooth</code> functions is the new backcasting mechanism for <code>adam()</code>, <code>es()</code> and <code>msarima()</code> (this is discussed in <a href="https://openforecast.org/adam/ADAMInitialisation.html">Section 11.4 of ADAM monograph</a>). The main difference with the old one is that now it does not backcast the parameters for the explanatory variables and estimates them separately via optimisation. This feature appeared to be important for some of users who wanted to try MSARIMAX/ETSX (a model with explanatory variables) but wanted to use backcasting as the initialisation. These users then wanted to get a summary, analysing the uncertainty around the estimates of parameters for exogenous variables, but could not because the previous implementation would not estimate them explicitly. This is now available. Here is an example:</p>
<pre class="decode">cbind(BJsales, BJsales.lead) |>
    adam(model="AAdN", initial="backcasting") |>
    summary()</pre>
<pre>Model estimated using adam() function: ETSX(AAdN)
Response variable: BJsales
Distribution used in the estimation: Normal
Loss function type: likelihood; Loss function value: 255.1935
Coefficients:
             Estimate Std. Error Lower 2.5% Upper 97.5%  
alpha          0.9724     0.1108     0.7534      1.0000 *
beta           0.2904     0.1368     0.0199      0.5607 *
phi            0.8798     0.0925     0.6970      1.0000 *
BJsales.lead   0.1662     0.2336    -0.2955      0.6276  

Error standard deviation: 1.3489
Sample size: 150
Number of estimated parameters: 5
Number of degrees of freedom: 145
Information criteria:
     AIC     AICc      BIC     BICc 
520.3870 520.8037 535.4402 536.4841</pre>
<p>As you can see in the output above, the initial level and trend of the model are not reported, because they were estimated via backcasting. However, we get the value of the parameter <code>BJsales.lead</code> and the uncertainty around it. The old backcasting approach is now called "complete", implying that all values of the state vector are produce via backcasting.</p>
<p>Second, <code>forecast.adam()</code> now has a parameter <code>scenarios</code>, which when TRUE will return the simulated paths from the model. This only works when <code>interval="simulated"</code> and can be used for the analysis of possible forecast trajectories.</p>
<p>Third, the <code>plot()</code> method now can also produce ACF/PACF for the squared residuals for all <code>smooth</code> functions. This becomes useful if you suspect that your data has ARCH elements and want to see if they need to be modelled separately. This can also be done using <code>adam()</code> and <code>sm()</code> and is discussed in <a href="https://openforecast.org/adam/ADAMscaleModel.html">Chapter 17 of the monograph</a>.</p>
<p>Finally, the <code>sma()</code> function now has the <code>fast</code> parameter, which when true will use a modified Ternary search for the best order based on information criteria. It might not give the global minimum, but it works much faster than the exhaustive search.</p>
<h3>Conclusions</h3>
<p>These are the main new features in the package. I feel that the main job in <code>smooth</code> is already done, and all I can do now is just tune the functions and improve the existing code. I want to move all the functions to the new engine and ditch the old one, but this requires much more time than I have. So, I don't expect to finish this any time soon, but I hope I'll get there someday. On the other hand, I'm not sure that spending much time on developing an R package is a wise idea, given that nowadays people tend to use Python. I would develop Python analogue of the <code>smooth</code> package, but currently I don't have the necessary expertise and time to do that. Besides, there already exist great libraries, such as <a href="https://github.com/Nixtla/nixtla/tree/main/tsforecast">tsforecast</a> from <a href="https://github.com/Nixtla/nixtla">nixtla</a> and <a href="https://www.sktime.org/">sktime</a>. I am not sure that another library, implementing ETS and ARIMA is needed in Python. What do you think?</p>
<p>Message <a href="https://openforecast.org/2023/01/30/smooth-v3-2-0-what-s-new/">smooth v3.2.0: what&#8217;s new?</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2023/01/30/smooth-v3-2-0-what-s-new/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>ISF2022: How to make ETS work with ARIMA</title>
		<link>https://openforecast.org/2022/07/20/isf2022-how-to-make-ets-work-with-arima/</link>
					<comments>https://openforecast.org/2022/07/20/isf2022-how-to-make-ets-work-with-arima/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Wed, 20 Jul 2022 12:06:48 +0000</pubDate>
				<category><![CDATA[adam()]]></category>
		<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[ADAM]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[ISF]]></category>
		<category><![CDATA[presentations]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=2984</guid>

					<description><![CDATA[<p>This time ISF took place in Oxford. I acted as a programme chair of the event and was quite busy with schedule and some other minor organisational things, but I still found time to present something new. Specifically, I talked about one specific part of ADAM, the part implementing ETS+ARIMA. The idea is that the [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2022/07/20/isf2022-how-to-make-ets-work-with-arima/">ISF2022: How to make ETS work with ARIMA</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This time ISF took place in Oxford. I acted as a programme chair of the event and was quite busy with schedule and some other minor organisational things, but I still found time to present something new. Specifically, I talked about one specific part of ADAM, the part implementing ETS+ARIMA. The idea is that the two models are considered as competing, belonging to different families. But we have known how to unite them at least since 1985. So, it is about time to make this brave step and implement ETS with ARIMA elements.</p>
<div id="attachment_2987" style="width: 235px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145.jpeg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2987" src="/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145-225x300.jpeg" alt="" width="225" height="300" class="size-medium wp-image-2987" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145-225x300.jpeg&amp;nocache=1 225w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145-768x1024.jpeg&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145-1152x1536.jpeg&amp;nocache=1 1152w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/07/7971a13b-ad97-4473-8a8f-4c88ad2d7145.jpeg&amp;nocache=1 1536w" sizes="auto, (max-width: 225px) 100vw, 225px" /></a><p id="caption-attachment-2987" class="wp-caption-text">ETS+ARIMA love story with happy ending&#8230;</p></div>
<p>This talk was based on <a href="https://openforecast.org/adam/ADAMARIMA.html">Chapter 9</a> of <a href="https://openforecast.org/adam/">ADAM monograph</a>, and more specifically on <a href="https://openforecast.org/adam/ETSAndARIMA.html">Section 9.4</a>.</p>
<p>The slides of the presentation are available <a href="/wp-content/uploads/2022/07/2022-ISF2022-ADAM-ETSARIMA.pdf">here</a>.</p>
<p>Message <a href="https://openforecast.org/2022/07/20/isf2022-how-to-make-ets-work-with-arima/">ISF2022: How to make ETS work with ARIMA</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2022/07/20/isf2022-how-to-make-ets-work-with-arima/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The first draft of &#8220;Forecasting and Analytics with ADAM&#8221;</title>
		<link>https://openforecast.org/2022/04/11/the-first-draft-of-forecasting-and-analytics-with-adam/</link>
					<comments>https://openforecast.org/2022/04/11/the-first-draft-of-forecasting-and-analytics-with-adam/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Mon, 11 Apr 2022 15:30:26 +0000</pubDate>
				<category><![CDATA[adam()]]></category>
		<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Regression]]></category>
		<category><![CDATA[Theory of forecasting]]></category>
		<category><![CDATA[ADAM]]></category>
		<category><![CDATA[regression]]></category>
		<category><![CDATA[smooth]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=2817</guid>

					<description><![CDATA[<p>After working on this for more than a year, I have finally prepared the first draft of my online monograph &#8220;Forecasting and Analytics with ADAM&#8220;. This is a monograph on the model that unites ETS, ARIMA and regression and introduces advanced features in univariate modelling, including: ETS in a new State Space form; ARIMA in [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2022/04/11/the-first-draft-of-forecasting-and-analytics-with-adam/">The first draft of &#8220;Forecasting and Analytics with ADAM&#8221;</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="attachment_2819" style="width: 222px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2022/03/Adam-Title-web.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2819" src="/wp-content/uploads/2022/03/Adam-Title-web-212x300.jpg" alt="Forecasting and Analytics with ADAM" width="212" height="300" class="size-medium wp-image-2819" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/Adam-Title-web-212x300.jpg&amp;nocache=1 212w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/Adam-Title-web-724x1024.jpg&amp;nocache=1 724w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/Adam-Title-web-768x1087.jpg&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/Adam-Title-web.jpg&amp;nocache=1 1000w" sizes="auto, (max-width: 212px) 100vw, 212px" /></a><p id="caption-attachment-2819" class="wp-caption-text">Forecasting and Analytics with ADAM</p></div>
<p>After working on this for <a href="/en/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/" rel="noopener">more than</a> <a href="/en/2021/02/28/after-the-creation-of-adam-smooth-v3-1-0/">a year</a>, I have finally prepared the first draft of my online monograph &#8220;<a href="https://openforecast.org/adam/" rel="noopener" target="_blank">Forecasting and Analytics with ADAM</a>&#8220;. This is a monograph on the model that unites ETS, ARIMA and regression and introduces advanced features in univariate modelling, including:</p>
<ol>
<li>ETS in a new State Space form;</li>
<li>ARIMA in a new State Space form;</li>
<li>Regression;</li>
<li>TVP regression;</li>
<li>Combinations of (1), (2) and either (3), or (4);</li>
<li>Automatic selection/combination for ETS;</li>
<li>Automatic orders selection for ARIMA;</li>
<li>Variables selection for regression part;</li>
<li>Normal and non-normal distributions;</li>
<li>Automatic selection of most suitable distribution;</li>
<li>Multiple seasonality;</li>
<li>Occurrence part of the model to handle zeroes in data (intermittent demand);</li>
<li>Modelling scale of distribution (GARCH and beyond);</li>
<li>Handling uncertainty of estimates of parameters.</li>
</ol>
<p>The model and all its features are already implemented in <code>adam()</code> function from <code>smooth</code> package for R (you need v3.1.6 from CRAN for all the features listed above). The function supports many options that allow one experimenting with univariate forecasting, allowing to build complex models, combining elements from the list above. The monograph explaining how models underlying ADAM and how to work with them is <a href="https://openforecast.org/adam/" rel="noopener" target="_blank">available online</a>, and I plan to produce several physical copies of it after refining the text. Furthermore, I have already asked two well-known academics to act as reviewers of the monograph to collect the feedback and improve the monograph, and if you want to act as a reviewer as well, please let me know.</p>
<h3>Examples in R</h3>
<p>Just to give you a flavour of ADAM, I decided to provide a couple of examples on time series <code>AirPassengers</code> (included in <code>datasets</code> package in R). The first one is the ADAM ETS.</p>
<p>Building and selecting the most appropriate ADAM ETS comes to running the following line of code:</p>
<pre class="decode">adamETSAir <- adam(AirPassengers, h=12, holdout=TRUE)</pre>
<p>In this case, ADAM will select the most appropriate ETS model for the data, creating a holdout of the last 12 observations. We can see the details of the model by printing the output:</p>
<pre class="decode">adamETSAir</pre>
<pre>Time elapsed: 0.75 seconds
Model estimated using adam() function: ETS(MAM)
Distribution assumed in the model: Gamma
Loss function type: likelihood; Loss function value: 467.2981
Persistence vector g:
 alpha   beta  gamma 
0.7691 0.0053 0.0000 

Sample size: 132
Number of estimated parameters: 17
Number of degrees of freedom: 115
Information criteria:
      AIC      AICc       BIC      BICc 
 968.5961  973.9646 1017.6038 1030.7102 

Forecast errors:
ME: 9.537; MAE: 20.784; RMSE: 26.106
sCE: 43.598%; Asymmetry: 64.8%; sMAE: 7.918%; sMSE: 0.989%
MASE: 0.863; RMSSE: 0.833; rMAE: 0.273; rRMSE: 0.254</pre>
<p>The output above provides plenty of detail on what was estimated and how. Some of these elements have been discussed in <a href="/en/2016/11/02/smooth-package-for-r-es-function-part-ii-pure-additive-models/">one of my previous posts</a> on <code>es()</code> function. The new thing is the information about the assumed distribution for the response variable. By default, ADAM works with Gamma distribution in case of multiplicative error model. This is done to make model more robust in cases of low volume data, where the Normal distribution might produce negative numbers (see <a href="/en/2021/06/30/isf2021-how-to-make-multiplicative-ets-work-for-you/">my presentation</a> on this issues). In case of high volume data, the Gamma distribution will perform similar to the Normal one. The pure multiplicative ADAM ETS is discussed in <a href="https://openforecast.org/adam/ADAMETSPureMultiplicativeChapter.html" rel="noopener" target="_blank">Chapter 6 of ADAM monograph</a>. If Gamma is not suitable, then the other distribution can be selected via the <code>distribution</code> parameter. There is also an automated distribution selection approach in the function <code>auto.adam()</code>:</p>
<pre class="decode">adamETSAutoAir <- auto.adam(AirPassengers, h=12, holdout=TRUE)
adamETSAutoAir</pre>
<pre>Time elapsed: 3.86 seconds
Model estimated using auto.adam() function: ETS(MAM)
Distribution assumed in the model: Normal
Loss function type: likelihood; Loss function value: 466.0744
Persistence vector g:
 alpha   beta  gamma 
0.8054 0.0000 0.0000 

Sample size: 132
Number of estimated parameters: 17
Number of degrees of freedom: 115
Information criteria:
      AIC      AICc       BIC      BICc 
 966.1487  971.5172 1015.1564 1028.2628 

Forecast errors:
ME: 9.922; MAE: 21.128; RMSE: 26.246
sCE: 45.36%; Asymmetry: 65.4%; sMAE: 8.049%; sMSE: 1%
MASE: 0.877; RMSSE: 0.838; rMAE: 0.278; rRMSE: 0.255</pre>
<p>As we see from the output above, the Normal distribution is more appropriate for the data in terms of AICc than the other ones tried out by the function (by default the list includes Normal, Laplace, S, Generalised Normal, Gamma, Inverse Gaussian and Log Normal distributions, but this can be amended by providing a vector of names via <code>distribution</code> parameter). The selection of ADAM ETS and distributions is discussed in <a href="https://openforecast.org/adam/ADAMSelection.html" rel="noopener" target="_blank">Chapter 15 of the monograph</a>.</p>
<p>Having obtained the model, we can diagnose it using <code>plot.adam()</code> function:</p>
<pre class="decode">par(mfcol=c(3,3))
plot(adamETSAutoAir,which=c(1,4,2,6,7,8,10,11,13))</pre>
<p>The <code>which</code> parameter specifies what type of plots to produce, you can find the list of plots in the documentation for <code>plot.adam()</code>. The code above will result in:<br />
<div id="attachment_2824" style="width: 310px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2022/03/adamETSAirDiagnostics.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2824" src="/wp-content/uploads/2022/03/adamETSAirDiagnostics-300x175.png" alt="Diagnostics plots for ADAM ETS on AirPassengers data" width="300" height="175" class="size-medium wp-image-2824" /></a><p id="caption-attachment-2824" class="wp-caption-text">Diagnostics plots for ADAM ETS on AirPassengers data</p></div>
The diagnostic plots are discussed in the <a href="https://openforecast.org/adam/diagnostics.html" rel="noopener" target="_blank">Chapter 14 of ADAM monograph</a>. The plot above does not show any serious issues with the model.</p>
<p>Just for the comparison, we could also try fitting the most appropriate ADAM ARIMA to the data (this model is discussed in <a href="https://openforecast.org/adam/ADAMARIMA.html" rel="noopener" target="_blank">Chapter 9</a>). The code in this case is slightly more complicated, because we need to switch off ETS part of the model and define the maximum orders of ARIMA to try:</p>
<pre class="decode">adamARIMAAir <- adam(AirPassengers, model="NNN", h=12, holdout=TRUE,
                     orders=list(ar=c(3,2),i=c(2,1),ma=c(3,2),select=TRUE))</pre>
<p>This results in the following <a href="https://openforecast.org/adam/ARIMASelection.html" rel="noopener" target="_blank">automatically selected</a> ARIMA model:</p>
<pre>Time elapsed: 3.54 seconds
Model estimated using auto.adam() function: SARIMA(0,1,1)[1](0,1,1)[12]
Distribution assumed in the model: Normal
Loss function type: likelihood; Loss function value: 491.7117
ARMA parameters of the model:
MA:
 theta1[1] theta1[12] 
   -0.1952    -0.0720 

Sample size: 132
Number of estimated parameters: 16
Number of degrees of freedom: 116
Information criteria:
     AIC     AICc      BIC     BICc 
1015.423 1020.154 1061.548 1073.097 

Forecast errors:
ME: -13.795; MAE: 16.65; RMSE: 21.644
sCE: -63.064%; Asymmetry: -79.4%; sMAE: 6.343%; sMSE: 0.68%
MASE: 0.691; RMSSE: 0.691; rMAE: 0.219; rRMSE: 0.21</pre>
<p>Given that ADAM ETS and ADAM ARIMA are formulated in the same framework, they are directly comparable using information critirea. Comparing AICc of the models <code>adamETSAutoAir</code> and <code>adamARIMAAir</code>, we can conclude that the former is more appropriate to the data than the latter. However, the default ARIMA works with the Normal distribution, which might not be appropriate for the data, so we can revert to the <code>auto.adam()</code> to select the better one:</p>
<pre class="decode">adamAutoARIMAAir <- auto.adam(AirPassengers, model="NNN", h=12, holdout=TRUE,
                              orders=list(ar=c(3,2),i=c(2,1),ma=c(3,2),select=TRUE))</pre>
<p>This will take more computational time, but will result in a different model with a lower AICc (which is still higher than the one in ADAM ETS):</p>
<pre>Time elapsed: 25.46 seconds
Model estimated using auto.adam() function: SARIMA(0,1,1)[1](0,1,1)[12]
Distribution assumed in the model: Log-Normal
Loss function type: likelihood; Loss function value: 472.923
ARMA parameters of the model:
MA:
 theta1[1] theta1[12] 
   -0.2785    -0.5530 

Sample size: 132
Number of estimated parameters: 16
Number of degrees of freedom: 116
Information criteria:
      AIC      AICc       BIC      BICc 
 977.8460  982.5764 1023.9708 1035.5197 

Forecast errors:
ME: -12.968; MAE: 13.971; RMSE: 19.143
sCE: -59.285%; Asymmetry: -91.7%; sMAE: 5.322%; sMSE: 0.532%
MASE: 0.58; RMSSE: 0.611; rMAE: 0.184; rRMSE: 0.186</pre>
<p>Note that although the AICc is higher for ARIMA than for ETS, the former has lower error measures than the latter. So, the higher AICc does not necessarily mean that the model is not good. But if we rely on the information criteria, then we should stick with ADAM ETS and we can then produce the forecasts for the next 12 observations (see <a href="https://openforecast.org/adam/ADAMForecasting.html" rel="noopener" target="_blank">Chapter 18</a>):</p>
<pre class="decode">adamETSAutoAirForecast <- forecast(adamETSAutoAir, h=12, interval="prediction",
                                   level=c(0.9,0.95,0.99))
par(mfcol=c(1,1))
plot(adamETSAutoAirForecast)</pre>
<div id="attachment_2839" style="width: 310px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast.png&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2839" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast-300x175.png&amp;nocache=1" alt="Forecast from ADAM ETS" width="300" height="175" class="size-medium wp-image-2839" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast-768x448.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2022/03/adamETSAirForecast.png&amp;nocache=1 1200w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2839" class="wp-caption-text">Forecast from ADAM ETS</p></div>
Finally, if we want to do a more in-depth analysis of parameters of ADAM, we can also produce the summary, which will create the confidence intervals for the parameters of the model:</p>
<pre class="decode">summary(adamETSAutoAir)</pre>
<pre>Model estimated using auto.adam() function: ETS(MAM)
Response variable: data
Distribution used in the estimation: Normal
Loss function type: likelihood; Loss function value: 466.0744
Coefficients:
            Estimate Std. Error Lower 2.5% Upper 97.5%  
alpha         0.8054     0.0864     0.6343      0.9761 *
beta          0.0000     0.0203     0.0000      0.0401  
gamma         0.0000     0.0382     0.0000      0.0755  
level        96.2372     6.8596    82.6496    109.7919 *
trend         2.0901     0.3955     1.3068      2.8716 *
seasonal_1    0.9145     0.0077     0.9003      0.9372 *
seasonal_2    0.8999     0.0081     0.8857      0.9227 *
seasonal_3    1.0308     0.0094     1.0165      1.0535 *
seasonal_4    0.9885     0.0077     0.9743      1.0112 *
seasonal_5    0.9856     0.0072     0.9713      1.0083 *
seasonal_6    1.1165     0.0093     1.1023      1.1392 *
seasonal_7    1.2340     0.0115     1.2198      1.2568 *
seasonal_8    1.2254     0.0105     1.2112      1.2481 *
seasonal_9    1.0668     0.0094     1.0526      1.0896 *
seasonal_10   0.9256     0.0087     0.9113      0.9483 *
seasonal_11   0.8040     0.0075     0.7898      0.8268 *

Error standard deviation: 0.0367
Sample size: 132
Number of estimated parameters: 17
Number of degrees of freedom: 115
Information criteria:
      AIC      AICc       BIC      BICc 
 966.1487  971.5172 1015.1564 1028.2628 </pre>
<p>Note that the <code>summary()</code> function might complain about the Observed Fisher Information. This is because the covariance matrix of parameters is calculated numerically and sometimes the likelihood is not maximised properly. I have not been able to fully resolve this issue yet, but hopefully will do at some point. The summary above shows, for example, that the smoothing parameters \(\beta\) and \(\gamma\) are not significantly different from zero (on 5% level), while \(\alpha\) is expected to vary between 0.6343 and 0.9761 in 95% of the cases. You can read more about the uncertainty of parameters in ADAM in <a href="https://openforecast.org/adam/ADAMUncertainty.html" rel="noopener" target="_blank">Chapter 16</a> of the monograph.</p>
<p>As for the other features of ADAM, here is a brief guide:</p>
<ul>
<li>If you work with multiple seasonal data, then you might need to specify the seasonality via the <code>lags</code> parameter, for example as <code>lags=c(24,7*24)</code> in case of hourly data. This is discussed in <a href="https://openforecast.org/adam/multiple-frequencies-in-adam.html" rel="noopener" target="_blank">Chapter 12</a>;</li>
<li>If you have intermittent data, then you should read <a href="https://openforecast.org/adam/ADAMIntermittent.html" rel="noopener" target="_blank">Chapter 13</a>, which explains how to work with the <code>occurrence</code> parameter of the function;</li>
<li>Explanatory variables are discussed in <a href="https://openforecast.org/adam/ADAMX.html" rel="noopener" target="_blank">Chapter 10</a> and are handled in the <code>adam()</code> function via the <code>formula</code> parameter;</li>
<li>In the cases of heteroscedasticity (time varying or induced by some explanatory variables), there a scale model (which is discussed in <a href="https://openforecast.org/adam/ADAMscaleModel.html" rel="noopener" target="_blank">Chapter 17</a> and implemented as <code>sm()</code> method for the <code>adam</code> class).</li>
</ul>
<p>You can also experiment with advanced estimators (<a href="https://openforecast.org/adam/ADAMETSEstimation.html" rel="noopener" target="_blank">Chapter 11</a>, including custom loss functions) via the <code>loss</code> parameter and forecast combinations (<a href="https://openforecast.org/adam/ADAMCombinations.html" rel="noopener" target="_blank">Section 15.4</a>).</p>
<p>Long story short, if you are interested in univariate forecasting, then do give ADAM a try - it might have the flexibility you needed for your experiments. If you are worried about its accuracy, check out <a href="/en/2021/02/28/after-the-creation-of-adam-smooth-v3-1-0/">this post</a>, where I compared ADAM with other models.</p>
<p>And, as a friend of mine says, "Happy forecasting!"</p>
<p>Message <a href="https://openforecast.org/2022/04/11/the-first-draft-of-forecasting-and-analytics-with-adam/">The first draft of &#8220;Forecasting and Analytics with ADAM&#8221;</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2022/04/11/the-first-draft-of-forecasting-and-analytics-with-adam/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The creation of ADAM &#8211; next step in statistical forecasting</title>
		<link>https://openforecast.org/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/</link>
					<comments>https://openforecast.org/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 11:24:18 +0000</pubDate>
				<category><![CDATA[adam()]]></category>
		<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[Package smooth for R]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Regression]]></category>
		<category><![CDATA[regression]]></category>
		<category><![CDATA[smooth]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=2552</guid>

					<description><![CDATA[<p>Good news everyone! The future of statistical forecasting is finally here :). Have you ever struggled with ETS and needed explanatory variables? Have you ever needed to unite ARIMA and ETS? Have you ever needed to deal with all those zeroes in the data? What about the data with multiple seasonalities? All of this and [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/">The creation of ADAM &#8211; next step in statistical forecasting</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Good news everyone! The future of statistical forecasting is finally here :). Have you ever struggled with ETS and needed explanatory variables? Have you ever needed to unite ARIMA and ETS? Have you ever needed to deal with all those zeroes in the data? What about the data with multiple seasonalities? All of this and more can now be solved by <code>adam()</code> function from smooth v3.0.1 package for R (<a href="https://cran.r-project.org/package=smooth">on its way to CRAN now</a>). ADAM stands for &#8220;Augmented Dynamic Adaptive Model&#8221; (I will talk about it in the next <a href="https://cmaf-fft.lp151.com/" rel="noopener" target="_blank">CMAF Friday Forecasting Talk</a> on 15th January). Now, what is ADAM? Well, something like this:</p>
<div id="attachment_2557" style="width: 310px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2020/12/Touched_by_His_Noodly_Appendage_HD-smooth.jpg&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2557" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2020/12/Touched_by_His_Noodly_Appendage_HD-smooth-300x142.jpg&amp;nocache=1" alt="ADAM, smooth and His Noodly Appendage Flying Spaghetti Monster" width="300" height="142" class="size-medium wp-image-2557" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2020/12/Touched_by_His_Noodly_Appendage_HD-smooth-300x142.jpg&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2020/12/Touched_by_His_Noodly_Appendage_HD-smooth-768x364.jpg&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2020/12/Touched_by_His_Noodly_Appendage_HD-smooth.jpg&amp;nocache=1 1000w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2557" class="wp-caption-text">The Creation of ADAM by <a href="http://www.androidarts.com/">Arne Niklas Jansson</a> with my adaptation</p></div>
<p>ADAM is the next step in time series analysis and forecasting. Remember <a href="/en/2016/10/14/smooth-package-for-r-es-i/">exponential smoothing</a> and functions like <code>es()</code> and <code>ets()</code>? Remember ARIMA and functions like <code>arima()</code>, <code>ssarima()</code>, <code>msarima()</code> etc? Remember your favourite <a href="/en/2019/01/07/marketing-analytics-with-greybox/">linear regression function</a>, e.g. <code>lm()</code>, <code>glm()</code> or <code>alm()</code>? Well, now these three models are implemented in a unified framework. Now you can have exponential smoothing with ARIMA elements and explanatory variables in one box: <code>adam()</code>. You can do ETS components and ARIMA orders selection, together with explanatory variables selection in one go. You can estimate ETS / ARIMA / regression using either likelihood of a selected distribution or using conventional losses like MSE, or even using your own custom loss. You can tune parameters of optimiser and experiment with initialisation and estimation of the model. The function can deal with multiple seasonalities and with intermittent data in one place. In fact, there are so many features that it is just easier to list the major of them:</p>
<ol>
<li>ETS;</li>
<li>ARIMA;</li>
<li>Regression;</li>
<li>TVP regression;</li>
<li>Combination of (1), (2) and either (3), or (4);</li>
<li>Automatic selection / combination of states for ETS;</li>
<li>Automatic orders selection for ARIMA;</li>
<li>Variables selection for regression part;</li>
<li>Normal and non-normal distributions;</li>
<li>Automatic selection of most suitable distributions;</li>
<li>Advanced and custom loss functions;</li>
<li>Multiple seasonality;</li>
<li>Occurrence part of the model to handle zeroes in data (intermittent demand);</li>
<li>Model diagnostics using plot() and other methods;</li>
<li>Confidence intervals for parameters of models;</li>
<li>Automatic outliers detection;</li>
<li>Handling missing data;</li>
<li>Fine tuning of persistence vector (smoothing parameters);</li>
<li>Fine tuning of initial values of the state vector (e.g. level / trend / seasonality / ARIMA components / regression parameters);</li>
<li>Two initialisation options (optimal / backcasting);</li>
<li>Provided ARMA parameters;</li>
<li>Fine tuning of optimiser (select algorithm and convergence criteria);</li>
<li>&#8230;</li>
</ol>
<p>All of this is based on the Single Source of Error state space model, which makes ETS, ARIMA and regression directly comparable via information criteria and opens a variety of modelling and forecasting possibilities. In addition, the code is much more efficient than the code of already existing smooth functions, so hopefully this will be a convenient function to use. I do not promise that everything will work 100% efficiently from scratch, because this is a new function, which implies that inevitably there are bugs and there is a room for improvement. But I intent to continue working on it, improving it further, based on the provided feedback (you can submit <a href="https://github.com/config-i1/smooth/issues">an issue on github</a> if you have ideas).</p>
<p>Keep in mind that starting from smooth v3.0.0 I will not be introducing new features in <code>es()</code>, <code>ssarima()</code> and other conventional functions for univariate variables in <code>smooth</code> &#8211; I will only fix bugs in them and possibly optimise some parts of the code, but there will be no innovations in them, given that the main focus from now on will be on <code>adam()</code>. To that extent, I have removed some experimental and not fully developed parameters from those functions (e.g. occurrence, oesmodel, updateX, persistenceX and transitionX).</p>
<p>Now, I realise that ADAM is something completely new and contains just too much information to cover in one post. As a result, I have started the work on an <a href="https://openforecast.org/adam/" rel="noopener" target="_blank">online textbook</a>. This is work in progress, missing some chapters, but it already covers many important elements of ADAM. If you find any mistakes in the text or formulae, please, use the &#8220;Open Review&#8221; functionality in the textbook to give me feedback or send me a message. This will be highly appreciated, because, working on this alone, I am sure that I have made plenty of mistakes and typos.</p>
<h3>Example in R</h3>
<p>Finally, it would be boring just to announce things and leave it like that. So, I&#8217;ve decided to come up with an R experiments on M, M3 and tourism competitions data, similar to how I&#8217;ve <a href="/en/2018/01/01/smooth-functions-in-2017/" rel="noopener" target="_blank">done it in 2017</a>, just to show how the function compares with the other conventional ones, measuring their accuracy and computational time:</p>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>Huge chunk of code in R</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode"># Load the packages. If the packages are not available, install them from CRAN
library(Mcomp)
library(Tcomp)
library(smooth)
library(forecast)

# Load the packages for parallel calculation
# This package is available for Linux and MacOS only
# Comment out this line if you work on Windows
library(doMC)

# Set up the cluster on all cores / threads.
## Note that the code that follows might take around 500Mb per thread,
## so the issue is not in the number of threads, but rather in the RAM availability
## If you do not have enough RAM,
## you might need to reduce the number of threads manually.
## But this should not be greater than the number of threads your processor can do.
registerDoMC(detectCores())

##### Alternatively, if you work on Windows (why?), uncomment and run the following lines
# library(doParallel)
# cl <- detectCores()
# registerDoParallel(cl)
#####

# Create a small but neat function that will return a vector of error measures
errorMeasuresFunction <- function(object, holdout, insample){
    return(c(measures(holdout, object$mean, insample),
             mean(holdout < object$upper &#038; holdout > object$lower),
             mean(object$upper-object$lower)/mean(insample),
             pinball(holdout, object$upper, 0.975)/mean(insample),
             pinball(holdout, object$lower, 0.025)/mean(insample),
             sMIS(holdout, object$lower, object$upper, mean(insample),0.95),
             object$timeElapsed))
}

# Create the list of datasets
datasets <- c(M1,M3,tourism)
datasetLength <- length(datasets)
# Give names to competing forecasting methods
methodsNames <- c("ADAM-ETS(ZZZ)","ADAM-ETS(ZXZ)","ADAM-ARIMA",
                  "ETS(ZXZ)","ETSHyndman","AutoSSARIMA","AutoARIMA");
methodsNumber <- length(methodsNames);
# Run adam on one of time series from the competitions to get names of error measures
test <- adam(datasets[[125]]);
# The array with error measures for each method on each series.
## Here we calculate a lot of error measures, but we will use only few of them
testResults <- array(NA,c(methodsNumber,datasetLength,length(test$accuracy)+6),
                             dimnames=list(methodsNames, NULL,
                                           c(names(test$accuracy),
                                             "Coverage","Range",
                                             "pinballUpper","pinballLower","sMIS",
                                             "Time")));

#### ADAM(ZZZ) ####
j <- 1;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="smooth") %dopar% {
    startTime <- Sys.time()
    test <- adam(datasets[[i]],"ZZZ");
    testForecast <- forecast(test, h=datasets[[i]]$h, interval="pred");
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### ADAM(ZXZ) ####
j <- 2;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="smooth") %dopar% {
    startTime <- Sys.time()
    test <- adam(datasets[[i]],"ZXZ");
    testForecast <- forecast(test, h=datasets[[i]]$h, interval="pred");
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### ADAMARIMA ####
j <- 3;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="smooth") %dopar% {
    startTime <- Sys.time()
    test <- adam(datasets[[i]], "NNN",
                 order=list(ar=c(3,2),i=c(2,1),ma=c(3,2),select=TRUE));
    testForecast <- forecast(test, h=datasets[[i]]$h, interval="pred");
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### ES(ZXZ) ####
j <- 4;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="smooth") %dopar% {
    startTime <- Sys.time()
    test <- es(datasets[[i]],"ZXZ");
    testForecast <- forecast(test, h=datasets[[i]]$h, interval="parametric");
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### ETS from forecast package ####
j <- 5;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="forecast") %dopar% {
    startTime <- Sys.time()
    test <- ets(datasets[[i]]$x);
    testForecast <- forecast(test, h=datasets[[i]]$h, level=95);
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### AUTO SSARIMA ####
j <- 6;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="smooth") %dopar% {
    startTime <- Sys.time()
    test <- auto.ssarima(datasets[[i]]);
    testForecast <- forecast(test, h=datasets[[i]]$h, interval=TRUE);
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

#### AUTOARIMA ####
j <- 7;
result <- foreach(i=1:datasetLength, .combine="cbind", .packages="forecast") %dopar% {
    startTime <- Sys.time()
    test <- auto.arima(datasets[[i]]$x);
    testForecast <- forecast(test, h=datasets[[i]]$h, level=95);
    testForecast$timeElapsed <- Sys.time() - startTime;
    return(errorMeasuresFunction(testForecast, datasets[[i]]$xx, datasets[[i]]$x));
}
testResults[j,,] <- t(result);

# If you work on Windows, don't forget to shutdown the cluster via the following command:
# stopCluster(cl)</pre>
</div></div>
<p>After running this code, we will get the big array (7x5315x21), which would contain many different error measures for <a href="/en/2019/08/25/are-you-sure-youre-precise-measuring-accuracy-of-point-forecasts/">point forecasts</a> and <a href="/en/2019/10/18/how-confident-are-you-assessing-the-uncertainty-in-forecasting/">prediction intervals</a>. We will not use all of them, but instead will extract MASE and RMSSE for point forecasts and Coverage, Range and sMIS for prediction intervals, together with computational time. Although it might be more informative to look at distributions of those variables, we will calculate mean and median values overall, just to get a feeling about the performance:<br />
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>A much smaller chunk of code in R</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode">round(apply(testResults[,,c("MASE","RMSSE","Coverage","Range","sMIS","Time")],
            c(1,3),mean),3)
round(apply(testResults[,,c("MASE","RMSSE","Range","MIS","Time")],
            c(1,3),median),3)</pre>
</div></div>
This will result in the following two tables (boldface shows the best performing functions):</p>
<pre><strong>Means</strong>:
               MASE RMSSE Coverage Range  sMIS  Time
ADAM-ETS(ZZZ) 2.415 2.098    0.888 1.398 2.437 0.654
ADAM-ETS(ZXZ) <strong>2.250 1.961    0.895</strong> 1.225 <strong>2.092</strong> 0.497
ADAM-ARIMA    2.551 2.203    0.862 0.968 3.098 5.990
ETS(ZXZ)      2.279 1.977    0.862 1.372 2.490 1.128
ETSHyndman    2.263 1.970    0.882 1.200 2.258 <strong>0.404</strong>
AutoSSARIMA   2.482 2.134    0.801 <strong>0.780</strong> 3.335 1.700
AutoARIMA     2.303 1.989    0.834 0.805 3.013 1.385

<strong>Medians</strong>:
               MASE RMSSE Range  sMIS  Time
ADAM-ETS(ZZZ) 1.362 1.215 0.671 0.917 0.396
ADAM-ETS(ZXZ) 1.327 1.184 0.675 0.909 0.310
ADAM-ARIMA    1.476 1.300 0.769 1.006 3.525
ETS(ZXZ)      1.335 1.198 0.616 0.931 0.551
ETSHyndman    1.323 <strong>1.181</strong> 0.653 0.925 <strong>0.164</strong>
AutoSSARIMA   1.419 1.271 <strong>0.577</strong> 0.988 0.909
AutoARIMA     <strong>1.310</strong> 1.182 0.609 <strong>0.881</strong> 0.322</pre>
<p>Some things to note from this:</p>
<ul>
<li>ADAM ETS(ZXZ) is the most accurate model in terms of mean MASE and RMSSE, it has the coverage closest to 95% (although none of the models achieved the nominal value because of the fundamental underestimation of uncertainty) and has the lowest sMIS, implying that it did better than the other functions in terms of prediction intervals;</li>
<li>The ETS(ZZZ) did worse than ETS(ZXZ) because the latter considers the multiplicative trend, which sometimes becomes unstable, producing exploding trajectories;</li>
<li>ADAM ARIMA is not performing well yet, because of the implemented order selection algorithm and it was the slowest function of all. I plan to improve it in future releases of the function;</li>
<li>While ADAM ETS(ZXZ) did not beat ETS from forecast package in terms of computational time, it was faster than the other functions;</li>
<li>When it comes to medians, <code>auto.arima()</code>, <code>ets()</code> and <code>auto.ssarima()</code> seem to be doing better than ADAM, but not by a large margin.
</ul>
<p>In order to see if the performance of functions is statistically different, we run <a href="/en/2020/08/17/accuracy-of-forecasting-methods-can-you-tell-the-difference/">the RMCB test</a> for MASE, RMSSE and MIS. Note that RMCB compares the median performance of functions. Here is the R code:<br />
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>A smaller chunk of code in R for the MCB test</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
<pre class="decode"># Load the package with the function
library(greybox)
# Run it for each separate measure, automatically producing plots
rmcbResultMASE <- rmcb(t(testResults[,,"MASE"]))
rmcbResultRMSSE <- rmcb(t(testResults[,,"RMSSE"]))
rmcbResultsMIS <- rmcb(t(testResults[,,"sMIS"]))</pre>
</div></div>
<p>And here are the figures that we get by running that code</p>
<div id="attachment_2599" style="width: 310px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE.png&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2599" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE-300x175.png&amp;nocache=1" alt="RMCB test for MASE" width="300" height="175" class="size-medium wp-image-2599" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE-768x448.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBMASE.png&amp;nocache=1 1200w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2599" class="wp-caption-text">RMCB test for MASE</p></div>
<div id="attachment_2598" style="width: 310px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE.png&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2598" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE-300x175.png&amp;nocache=1" alt="RMCB test for RMSSE" width="300" height="175" class="size-medium wp-image-2598" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE-768x448.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBRMSSE.png&amp;nocache=1 1200w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2598" class="wp-caption-text">RMCB test for RMSSE</p></div>
<p>As we can see from the two figures above, ADAM-ETS(Z,X,Z) performs better than the other functions, although statistically not different than ETS implemented in <code>es()</code> and <code>ets()</code> functions. ADAM-ARIMA is the worst performing function for the moment, as we have already noticed in the previous analysis. The ranking is similar for both MASE and RMSSE.</p>
<p>And here is the sMIS plot:</p>
<div id="attachment_2597" style="width: 310px" class="wp-caption aligncenter"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS.png&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2597" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS-300x175.png&amp;nocache=1" alt="RMCB test for sMIS" width="300" height="175" class="size-medium wp-image-2597" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS-300x175.png&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS-1024x597.png&amp;nocache=1 1024w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS-768x448.png&amp;nocache=1 768w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2021/01/adamTestsRMCBsMIS.png&amp;nocache=1 1200w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2597" class="wp-caption-text">RMCB test for sMIS</p></div>
<p>When it comes to sMIS, the leader in terms of medians is <code>auto.arima()</code>, doing quite similar to <code>ets()</code>, but this is mainly because they have lower ranges, incidentally resulting in lower than needed coverage (as seen from the summary performance above). ADAM-ETS does similar to <code>ets()</code> and <code>es()</code> in this aspect (the intervals of the three intersect).</p>
<p>Obviously, we could provide more detailed analysis of performance of functions on different types of data and see, how they compare in each category, but the aim of this post is just to demonstrate how the new function works, I do not have intent to investigate this in detail.</p>
<p>Finally, I will present ADAM with several case studies in <a href="https://cmaf-fft.lp151.com/" rel="noopener" target="_blank">CMAF Friday Forecasting Talk</a> on 15th January. If you are interested to hear more and have some questions, please <a href="https://www.meetup.com/cmaf-friday-forecasting-talks/" rel="noopener" target="_blank">register on MeetUp</a> or <a href="https://www.linkedin.com/events/cmaffft-toinfinityandbeyond-for6751883043834773504/" rel="noopener" target="_blank">via LinkedIn</a> and join us online.</p>
<p>Message <a href="https://openforecast.org/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/">The creation of ADAM &#8211; next step in statistical forecasting</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2021/01/13/the-creation-of-adam-next-step-in-statistical-forecasting/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SMUG2019</title>
		<link>https://openforecast.org/2019/04/19/smug2019/</link>
					<comments>https://openforecast.org/2019/04/19/smug2019/#respond</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Fri, 19 Apr 2019 15:47:25 +0000</pubDate>
				<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[Artificial Intelligence and Machine Learning]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[AI and ML]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[presentations]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=1953</guid>

					<description><![CDATA[<p>I was recently invited to attend the SMUG2019 conference (SMoothie Users Group), organised by Demand Works company in New York. They asked me to present two topics: State space ARIMA for Supply Chain Forecasting, based on which I have developed a module for Smoothie a couple of years ago, Artificial Intelligence in Business, one of [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2019/04/19/smug2019/">SMUG2019</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I was recently invited to attend the SMUG2019 conference (SMoothie Users Group), organised by Demand Works company in New York. They asked me to present two topics:</p>
<ol>
<li><a href="/en/2019/04/05/state-space-arima-for-supply-chain-forecasting/">State space ARIMA for Supply Chain Forecasting</a>, based on which I have developed a module for Smoothie a couple of years ago,</li>
<li>Artificial Intelligence in Business, one of the modern hot topics that the company wanted to know a little bit more about.</li>
</ol>
<div id="attachment_1957" style="width: 310px" class="wp-caption alignnone"><a href="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2019/04/2019-04-18-NY-SMUG.jpeg&amp;nocache=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1957" class="size-medium wp-image-1957" src="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2019/04/2019-04-18-NY-SMUG-300x219.jpeg&amp;nocache=1" alt="" width="300" height="219" srcset="https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2019/04/2019-04-18-NY-SMUG-300x219.jpeg&amp;nocache=1 300w, https://openforecast.org/wp-content/webpc-passthru.php?src=https://openforecast.org/wp-content/uploads/2019/04/2019-04-18-NY-SMUG.jpeg&amp;nocache=1 768w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1957" class="wp-caption-text">Presentation at SMUG2019</p></div>
<p>The conference was interesting, showing what the company does and what it stands for. They are doing a good job in developing the software for forecasting and inventory control and supporting their users. Plus, I finally had a chance to meet in person with both founders of the company (Bill Tonetti and Eric Townson), as well as with the other members of their team. Overall, it was a pleasant experience and an interesting event.</p>
<p>As for the presentations, they seemed to go well, and the participants of the conference looked satisfied. Here are the slides:</p>
<ol>
<li><a href="https://openforecast.org/wp-content/uploads/2019/04/SMUG2019-Svetunkov-ARIMA.pdf">SMUG2019 &#8211; Svetunkov &#8211; ARIMA</a></li>
<li><a href="https://openforecast.org/wp-content/uploads/2019/04/SMUG2019-Svetunkov-AI-in-Business.pdf">SMUG2019 &#8211; Svetunkov &#8211; AI in Business</a></li>
</ol>
<p>Message <a href="https://openforecast.org/2019/04/19/smug2019/">SMUG2019</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2019/04/19/smug2019/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A simple combination of univariate models</title>
		<link>https://openforecast.org/2019/04/18/a-simple-combination-of-univariate-models/</link>
					<comments>https://openforecast.org/2019/04/18/a-simple-combination-of-univariate-models/#comments</comments>
		
		<dc:creator><![CDATA[Ivan Svetunkov]]></dc:creator>
		<pubDate>Thu, 18 Apr 2019 08:39:17 +0000</pubDate>
				<category><![CDATA[Applied forecasting]]></category>
		<category><![CDATA[ARIMA]]></category>
		<category><![CDATA[CES]]></category>
		<category><![CDATA[ETS]]></category>
		<category><![CDATA[Univariate models]]></category>
		<category><![CDATA[papers]]></category>
		<guid isPermaLink="false">https://openforecast.org/?p=1949</guid>

					<description><![CDATA[<p>Fotios Petropoulos and I have participated last year in M4 competition. Our approach performed well, finishing as 6th in the competition. This paper in International Journal of Forecasting explains what we used in our approach and why. Here&#8217;s the abstract: This paper describes the approach that we implemented for producing the point forecasts and prediction [&#8230;]</p>
<p>Message <a href="https://openforecast.org/2019/04/18/a-simple-combination-of-univariate-models/">A simple combination of univariate models</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://researchportal.bath.ac.uk/en/persons/fotios-petropoulos" rel="noopener noreferrer" target="_blank">Fotios Petropoulos</a> and I have participated last year in M4 competition. Our approach performed well, finishing as 6th in the competition. <a href="https://doi.org/10.1016/j.ijforecast.2019.01.006" rel="noopener noreferrer" target="_blank">This paper in International Journal of Forecasting</a> explains what we used in our approach and why. Here&#8217;s the abstract:</p>
<p>This paper describes the approach that we implemented for producing the point forecasts and prediction intervals for our M4-competition submission. The proposed simple combination of univariate models (SCUM) is a median combination of the point forecasts and prediction intervals of four models, namely exponential smoothing, complex exponential smoothing, automatic autoregressive integrated moving average and dynamic optimised theta. Our submission performed very well in the M4-competition, being ranked 6th for the point forecasts (with a small difference compared to the 2nd submission) and prediction intervals and 2nd and 3rd for the point forecasts of the weekly and quarterly data respectively.</p>
<p><a href="https://doi.org/10.1016/j.ijforecast.2019.01.006" rel="noopener noreferrer" target="_blank">Paper in IJF</a>.<br />
<a href="https://openforecast.org/wp-content/uploads/2019/04/IJF-2019-SCUM-post-print.pdf">Postprint of the paper</a>.</p>
<p>Message <a href="https://openforecast.org/2019/04/18/a-simple-combination-of-univariate-models/">A simple combination of univariate models</a> first appeared on <a href="https://openforecast.org">Open Forecasting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://openforecast.org/2019/04/18/a-simple-combination-of-univariate-models/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
