mscryptoph

forecastbch

Mar 16th, 2021
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. library(prophet)
  2. library(readxl)
  3.  
  4. bch <- read_excel("C:/Users/user/Desktop/bchdata/bch.xls",
  5. col_types = c("numeric", "date"))
  6. **you can replace the directory for the location of your data**
  7.  
  8. df2 <- bch
  9. m <- prophet(df2)
  10. future <- make_future_dataframe(m, periods = 365)
  11. tail(future)
  12. forecast <- predict(m, future)
  13. tail(forecast[c('ds', 'yhat', 'yhat_lower', 'yhat_upper')])
  14. plot(m, forecast)
  15.  
  16. prophet_plot_components(m, forecast)
  17. dyplot.prophet(m, forecast, main="Bitcoin Cash Forecast")
Advertisement
Add Comment
Please, Sign In to add comment