<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/smooth-v2-0-0-whats-new/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://forecasting.svetunkov.ru/en/2017/07/03/smooth-v2-0-0-whats-new/"> R – Modern Forecasting</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Good news, everyone!
<pre>smooth</pre>
<p> package has recently received a major update. The <a rel="nofollow" href="https://goo.gl/op7zyR" target="_blank">version on CRAN</a> is now v2.0.0. I thought that this is a big deal, so I decided to pause for a moment and explain what has happened, and why this new version is interesting.</p>
<p>First of all, there is a new function,
<pre>ves()</pre>
<p>, that implements Vector Exponential Smoothing model. This model allows estimating several series together and capture possible interactions between them. It can be especially useful if you need to forecast several similar products and can assume that smoothing parameter or initial seasonal indices are similar across all the series. Let’s say, you want to produce forecasts for several SKUs of cofvefe. You may unite the data of their sales in a vector and use one and the same smoothing parameter across the series using the parameter
<pre>persistence=&quot;group&quot;</pre>
<p>. However, if you think that sales of one type of cofvefe may influence the sales of the other one, you may take this into account and set
<pre>persistence=&quot;dependent&quot;</pre>
<p>. You can also switch between
<pre>&quot;group&quot;</pre>
<p> or
<pre>&quot;individual&quot;</pre>
<pre>initial</pre>
<p> values,
<pre>initialSeason</pre>
<p>,
<pre>transition</pre>
<p> and
<pre>phi</pre>
<p> (damping parameter). Just keep in mind that vector models can be greedy in the number of parameters and in order to use them efficiently, you my need to have large samples.</p>
<p>The function
<pre>ves()</pre>
<p> currently allows constructing either additive or multiplicative models of any kind, but I don’t intend on creating mixed models. First of all, they are cumbersome, secondly, they are hard to implement, thirdly, they <a rel="nofollow" href="http://forecasting.svetunkov.ru/en/2017/01/24/smooth-package-for-r-es-function-part-iv-model-selection-and-combination-of-forecasts/" target="_blank">contradict common sense</a> and, finally, I think that they are evil. As a result I also decided not to kill myself over rewriting the conventional multiplicative model and simplified things a lot by just working in logarithms. So, for example, VES(M,N,N) is in fact VES(A,N,N) applied to the data in logarithms. This simplification should not change things substantially, because we already assume that the errors are distributed log-normally in multiplicative models implemented in
<pre>es()</pre>
<p>. The results of multiplicative
<pre>ves()</pre>
<p> and
<pre>es()</pre>
<p> applied to the same time series should be comparable.</p>
<p>The function currently lacks several important elements (i.e. prediction intervals and exogenous variables), but it will be improved over the time and closer to the version 2.5.0 it will be a kick-ass function. You can have a look at several examples of the usage of
<pre>ves()</pre>
<p> in the <a rel="nofollow" href="https://cran.r-project.org/web/packages/smooth/vignettes/ves.html" target="_blank">vignettes</a>. I will also make a separate post about this function at some point, so stay tuned!</p>
<p>Second, I have slightly optimised C++ code, which, as it seems, led to the increase of the speed of the functions. I observed the increase of around 25% on average. But this may depend on PC, the data and the complexity of the applied model.</p>
<p>Third, now there is a new parameter in forecasting functions of
<pre>smooth</pre>
<p> —
<pre>imodel</pre>
<p>. It determines the type of model that should be used for the occurrence part of the intermittent models. Currently it works only with Croston’s model, because TSB needs additional code modifications and is not as easy. This allows using, for example, multiplicative trend model for the probability update instead of just level model. So
<pre>imodel=&quot;MMN&quot;</pre>
<p> would construct a model with time varying probability with trend.</p>
<p>In addition, model, estimated using
<pre>iss()</pre>
<p> function (which has class “iss”), can be provided in
<pre>imodel</pre>
<p> and reused by
<pre>es()</pre>
<p>,
<pre>ces()</pre>
<p> and the other
<pre>smooth</pre>
<p> functions. At the same time
<pre>es()</pre>
<p> and the others now also return the estimated occurrence part of the model as
<pre>imodel</pre>
<p> which can then be used for different purposes. All of that gives more flexibility in the model construction and should be useful for research purposes (at minimum — for my research).</p>
<p>There are other cool updates (<a rel="nofollow" href="https://cran.r-project.org/web/packages/smooth/NEWS" target="_blank">have a look</a>), new features and a bunch of bugfixes in the version 2.0.0. From now on I intend to continue improving VES (because I need it for one of my research projects), work on TSB part of intermittent model and create a simulation function for the occurrence part of iETS models.</p>
<p>Finally, while you are still here can you, please, take part in a very simple survey? It will take 5 seconds of your time, but hopefully will help me make up my mind. I just want to know if the current default value for the
<pre>silent</pre>
<p> parameter in
<pre>smooth</pre>
<p> functions is good for you. One of the ideas (proposed by <a rel="nofollow" href="http://kourentzes.com/forecasting/" target="_blank">Nikos Kourentzes</a>) is to make
<pre>silent=&quot;all&quot;</pre>
<p> the default one, but I’m hesitant. So, please, help me decide. You can vote here:</p>
<p><iframe width="450" src="https://docs.google.com/forms/u/0/d/e/1FAIpQLSeD4MUBjtul_aQ1dESp7BNGhw0XH6rdd1MH98h-rihS0ICDLw/viewform?embedded=true">Loading…</iframe></p>
<p>Thanks and see you next time!</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://forecasting.svetunkov.ru/en/2017/07/03/smooth-v2-0-0-whats-new/"> R – Modern Forecasting</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/F1KqOd7gn5g" height="1"></a></div>