2

I am new to using fbprophet and have a question about using the predict function.

As an example, I am using fbprophet to extrapolate Apples revenue for the next 5 years. Below is the code using the default settings.

m = Prophet()

m.fit(data)

future = m.make_future_dataframe(periods=5*365)

forecast = m.predict(future)

m.plot(forecast)
m.plot_components(forecast)

plt.show()

The results: enter image description here

enter image description here

If I choose to remove the "yearly seasonality", I get a linear regression that fits much better.

enter image description here

My question is why do the predicted yhat results blow up so much when yearly seasonality is included. As shown, turning the option off produces a linear regression model but I'm unsure whether this model is most suitable for the data. Any suggestions would be much appreciated.

1 Answers1

0

It looks like you are using monthly data and not daily data. So instead of using "periods=5*365" you can change the freq to monthly.

Example:

future_pd = m.make_future_dataframe(periods = 12 * 5,
                                    freq='MS',
                                    include_history=True)
SqHu
  • 99
  • 1
  • 5