<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/data-science-for-operational-excellence-part-5/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.r-exercises.com/2017/05/03/data-science-for-operational-excellence-part-5-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=data-science-for-operational-excellence-part-5-exercises"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/www.r-exercises.com/wp-content/uploads/2017/04/code-1839406__340.jpg"><img sizes="(max-width: 150px) 100vw, 150px" alt="" class="wp-image-4872" src="https://i1.wp.com/www.r-exercises.com/wp-content/uploads/2017/04/code-1839406__340-150x150.jpg?resize=150%2C150" data-recalc-dims="1"></a></p>
<p>Operations need to have demand forecasts in order to establish optimal resource allocation policies. But, when we make predictions the only thing that we assure is the occurrence of prediction errors. Fortunately, there is no need to be 100% accurate to succeed, we just need to perform better than our competitors. In this exercise we will learn a practical approach to predict using the forecast package. </p>
<p>Answers to the exercises are available <a target="_blank" rel="nofollow" href="http://r-exercises.com/2017/05/03/data-science-for-operational-excellence-part-5-solutions/">here</a>.</p>
<p><strong>Exercise 1</strong><br>
Plot the fmsales data from expsmooth package.</p>
<p><strong>Exercise 2</strong><br>
The data obtained are in weeks. In order to learn how to manipulate <code>ts</code> function, create a new time serie, which is based on the previously one, starting at January, 2011.</p>
<p><strong>Exercise 3</strong><br>
Use <code>decompose</code> function to plot: observed, trend, seasonal and random.</p>
<p><strong>Exercise 4</strong><br>
Use the moving average approach to create a vector of predictions. Consider that in this company you cannot change your purchasing planning for the next 3 months (time fence). So, there is no need of rolling statistics and you only need to make plans 4 times per year.</p>
<p><strong>Exercise 5</strong><br>
Use the function <code>accuracy</code> to compare the actual values and de predicting ones.</p>
<div>
<aside><img src="http://www.r-exercises.com/2017/05/03/data-science-for-operational-excellence-part-5-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=data-science-for-operational-excellence-part-5-exercises"></aside>
<div><strong>Learn more</strong> about Forecasting in the online course <a target="_blank" rel="nofollow" href="http://www.r-exercises.com/product/time-series-analysis-and-forecasting-in-r/">Time Series Analysis and Forecasting in R</a>. In this course you will learn how to:
<ul>
<li>A complete introduction on Forecasting</li>
<li>Work thru an exponentional smoothing instruction</li>
<li>And much more</li>
</ul>
</div>
</div>
<p><strong>Exercise 6</strong><br>
Use the a simple exponential approach to create a vector of predictions. Consider the same time fence and planning event previously defined.</p>
<p><strong>Exercise 7</strong><br>
Calculate the accuracy again and compare the performance using RSME. Which one is the best?</p>
<p><strong>Exercise 8</strong><br>
Use the a double exponential approach, that consider trends, to make predictions for the next 3 months.</p>
<p><strong>Exercise 9</strong><br>
Use the a triple exponential approach, that consider trend, and seasonal components, to make predictions for the next 3 months.</p>
<p><strong>Exercise 10</strong><br>
Use the <code>summary</code> function to find the RMSE and other information of this last model.</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a title="Forecasting: Exponential Smoothing Exercises (Part-3)" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2017/04/17/forecasting-exponential-smoothing-exercises-part-3/">Forecasting: Exponential Smoothing Exercises (Part-3) </a></li>
<li><a title="Forecasting for small business Exercises (Part-3)" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2017/04/25/forecasting-for-small-business-exercises-part-3/">Forecasting for small business Exercises (Part-3) </a></li>
<li><a title="Forecasting: Time Series Exploration Exercises (Part-1)" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2017/04/10/forecasting-time-series-exploration-exercises-part-1/">Forecasting: Time Series Exploration Exercises (Part-1) </a></li>
<li><a target="_blank" rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/">Explore all our (>1000) R exercises</a></li>
<li><a target="_blank" rel="nofollow" href="http://www.r-exercises.com/r-courses/">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
<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://www.r-exercises.com/2017/05/03/data-science-for-operational-excellence-part-5-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=data-science-for-operational-excellence-part-5-exercises"> R-exercises</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/-VHzYiW6Sj0"></a></div>