title: Adding Independent Variables to Prophet Package
body: <p>There is an R package called <code>prophet</code> which is very good. It is a generalized additive model. The dependent variable is the the metric you are trying to solve and the independent variables are: the growth function, seasonality function, and a variable that will account for things not found in those two variables. I want to be able to add another independent variable. For example:</p>
  <p>Let's say I want to solve for Page Views. I have the past nine years worth of data and in this package it will take the seasonality and growth rate into account to solve for this. How would I include another independent variable such as &quot;Temperature&quot;?</p>
  <p>This is what the equation looks like behind the scenes:</p>
  <pre><code>Page_Views = g(t) + s(t) + e(t)
  </code></pre>
  <p>I want to add another variable:</p>
  <pre><code>Page_Views = g(t) + s(t) + Beta(Temperature) + e(t)
  </code></pre>
  <p>How would I do this in the prophet package?</p>
  <p>Here is a tutorial on how to use the package:
  <a href="https://cran.r-project.org/web/packages/prophet/vignettes/quick_start.html" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/prophet/vignettes/quick_start.html</a></p>
  <p>Data is found here: <a href="https://github.com/facebookincubator/prophet/blob/master/examples/example_wp_peyton_manning.csv" rel="nofollow noreferrer">https://github.com/facebookincubator/prophet/blob/master/examples/example_wp_peyton_manning.csv</a></p>
  <pre><code>library(prophet)
  m&lt;-prophet(df)
  future &lt;- make_future_dataframe(m, period = 365)
  forecast &lt;- prophet:::predict.prophet(m, future)
  plot(m, forecast)
  </code></pre>
  <p>The main question I want to know is: &quot;Is there a way to add an additional independent variable to my generalized additive model in the prophet package?</p>
  <p>Thanks, any help would be great!</p>