<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/prophet-how-facebook-operationalizes-time-series-forecasting-at-scale/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/02/facebook-prophet.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Facebook is a <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2014/05/facebooks-on-line-course-on-exploratory-data-analysis-with-r.html">famously data-driven</a> organization, and an important goal in any data science activity is forecasting. Now, Facebook has released <a target="_blank" rel="nofollow" href="https://facebookincubator.github.io/prophet/">Prophet</a>, an open-source package for R and Python that implements the time-series methodology that Facebook <a target="_blank" rel="nofollow" href="https://twitter.com/seanjtaylor/status/834818352992251904">uses in production</a> for forecasting at scale.</p>
<p>Prophet has a very simple interface: you pass it a column of dates and a column of numbers, and is produces a forecast for the time series, like this:</p>
<p><a target="_blank" rel="nofollow" href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01bb097cdf4e970d-pi"><img title="Prophet forecast" alt="Prophet forecast" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01bb097cdf4e970d-800wi" border="0"></a></p>
<p>The black dots are the number of views of Peyton Manning's Wikipedia page through the end of 2016; the blue region is a forecast (with uncertainty interval) into 2017. As you can see, the Prophet forecast automatically detects the seasonal cycles (presumably related to NFL seasons). The <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/prophet/versions/0.1/topics/prophet">prophet function</a> also provides options to explicitly model weekly and/or yearly seasonality, account for holidays, and to specify changepoints where discontinuities in the time series are expected. It also supports modeling logistic growth, where each data point is measured against a maximum possible capacity.</p>
<p>The underlying model behing the forecast is described <a target="_blank" rel="nofollow" href="https://facebookincubator.github.io/prophet/static/prophet_paper_20170113.pdf">in this paper</a>. It's not your traditional ARIMA-style time series model. It's closer in spirit to a Bayesian-influenced <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Generalized_additive_model">generalized additive model</a>, a regression of smooth terms. The model is resistant to the effects of outliers, and supports data collected over an irregular time scale (ingliding presence of missing data) without the need for interpolation. The underlying calculation engine is <a target="_blank" rel="nofollow" href="http://mc-stan.org/">Stan</a>; the R and Python packages simply provide a convenient interface.</p>
<p>Prophet is billed as a platform for &quot;forecasting at scale&quot;, but here &quot;scale&quot; does <em>not</em> refer to data size or computational speed (as we are accustomed to in this domain). As authors Sean Taylor and Ben Letham write in the aforementioned <a target="_blank" rel="nofollow" href="https://facebookincubator.github.io/prophet/static/prophet_paper_20170113.pdf">paper</a>:</p>
<blockquote>
<p>The actual problems of scale we have observed in practice involve the complexity introduced by the variety of forecasting problems and building trust in a large number of forecasts once they have been produced.</p>
</blockquote>
<p>With its simple interface that automates much of the process of finding a &quot;best fit&quot; characterization of a complex time series, Prophet scales easily to a large number of users who need many forecasts of qualitatively many different kinds of data, without in-depth expertise in time series modeling techniques. </p>
<p>You can find out more about Prophet, including how to install it for R and Python, at the link below.</p>
<p>Facebook Open Source: <a target="_blank" rel="nofollow" href="https://facebookincubator.github.io/prophet/">Prophet</a></p>
</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://blog.revolutionanalytics.com/2017/02/facebook-prophet.html"> Revolutions</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/9XJ_rTM4ZYg"></a></div>