facebook / facebook/prophet

Predict a negative number for a stock whose entire history has been positive.

Open
#2,100 1 comment 4 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

Hello, I used the Prophet model to forecast Apple's stock ('AAPL') for the next 15 days. I was astonished to see that the model predicts negative figures for AAPL stock, which has never had a negative value before.
What may be the source of the issue?
Sample issue:
![1](https://user-images.githubusercontent.com/61683254/149616683-331a9ded-0172-4d11-bb8e-63861856f142.PNG)
![2](https://user-images.githubusercontent.com/61683254/149616684-2484c0ec-23bc-4fc1-acdf-5f9807018d36.PNG)
Code:
```
today = datetime.today().strftime('%Y-%m-%d')
start_date = '2016-01-01'
eth_df = yf.download('AAPL',start_date, today)
eth_df.reset_index(inplace=True)
df = eth_df[["Date", "Open"]]
new_names = {
"Date": "ds",
"Open": "y",
}
df.rename(columns=new_names, inplace=True)
m = Prophet(
seasonality_mode="multiplicative"
)
m.fit(df)
future = m.make_future_dataframe(periods = 15)
forecast = m.predict(future)
plot_plotly(m, forecast)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.