0
$\begingroup$

I would like to add prediction intervals to a temporal aggregation using the thief package. Can someone point out either how to automatically plot prediction intervals, or a method of calculating them? I've included an example using a sample data set that is very similar to my real data.

library(tidyverse)
library(ggplot2)
library(fpp2)
library(thief)

AEdemand.train <- AEdemand[,1] %>% subset(end   = floor(length(.)*0.8)-1)
AEdemand.test  <- AEdemand[,1] %>% subset(start = floor(length(.)*0.8))

Horizon <- AEdemand.test %>% length()

ftbats <- function(y,h,...){forecast(tbats(y),h,...)}

AEdemand.thief <- AEdemand.train %>% thief(forecastfunction=ftbats)
AEdemand.plot <- AEdemand.thief %>%
                 forecast(h=Horizon) %>%
                    autoplot()+
                        autolayer(AEdemand.test)+
                        ylab("Type 1 Departments - Major A&E")
plot(AEdemand.plot)

Forecasts from THieF-FTBATS without prediction intervals

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.