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 agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.