I found this tutorial here that shows how to plot time series and confidence intervals : dygraphs for R (scroll to bottom)
I tried to do this for a different class of models:
library(forecast)
# Fit the ARIMA model
fit <- auto.arima(ldeaths)
# Get the predictions with 95% confidence interval
pred <- forecast(fit, h=12, level=0.95)
library(dygraphs)
dygraph(cbind(ldeaths, pred$lower, pred$mean, pred$upper), main = "Deaths from Lung Disease (UK)") %>%
dySeries("ldeaths", label = "Actual") %>%
dySeries(c("pred$lower", "pred$mean", "pred$upper"), label = "Predicted", fill = "red")
Have I done this correctly?
Thanks!