if (FALSE) demo(exampleScript)
if (FALSE) {
## Build data and test
library(Mcomp)
M3.data <- subset(M3,"yearly")
train.data = list()
future.data = list()
for (i in 1:645)
{
train.data[[i]] = as.numeric(M3.data[[i]]$x)
future.data[[i]] = as.numeric(M3.data[[i]]$xx)
}
## Test -- change below to test more series
w.series = 1:20
# w.series = 1:645 # uncomment to test all series
# use 10,000 posterior samples; change n.samples to 20,000 to test that as well if you want
s = system.time({
rv=blgt.multi.forecast(train.data[w.series], future.data[w.series], n.samples=1e4)
})
s # overall timing info
s[[3]] / length(w.series) # per series time
mean(rv$sMAPE) # performance in terms of mean sMAPE
mean(rv$InCI)/6 # coverage of prediction intervals -- should be close to 95%
}
Run the code above in your browser using DataLab