basicf.RdBasic forecasting functions for multivariate time series
A multivariate time series of class ts or a matrix
Forecasting horizon
Confidence level for prediction intervals
forecasting method, either "mean", "median", or random walk ("rw")
type of prediction interval currently, "gaussian", "bootstrap", "blockbootstrap" or "movingblockbootstrap"
length of block for (circular) "blockbootstrap" or "movingblockbootstrap"
reproducibility seed for type_pi == 'bootstrap'
Number of bootstrap replications for type_pi == 'bootstrap'
A boolean; show progress bar for bootstrapping? Default is TRUE.
An object of class "mtsforecast"; a list containing the following elements:
The name of the forecasting method as a character string
Point forecasts for the time series
Lower bound for prediction interval
Upper bound for prediction interval
Model simulations for bootstrapping (basic, or block)
The original time series
Residuals from the fitted model
Regression coefficients for type_pi == 'gaussian' for now
if (FALSE) { # \dontrun{
require(fpp2)
res <- ahead::basicf(fpp2::insurance, h=10)
par(mfrow=c(1, 2))
plot(res, "TV.advert")
plot(res, "Quotes")
res <- ahead::basicf(fpp2::insurance, method="rw", h=10)
par(mfrow=c(1, 2))
plot(res, "TV.advert")
plot(res, "Quotes")
# block bootstrap
res3 <- ahead::basicf(fpp2::insurance, h=10, type_pi = "bootstrap", B=10)
res5 <- ahead::basicf(fpp2::insurance, h=10, type_pi = "blockbootstrap", B=10,
block_length = 4)
print(res3$sims[[2]])
print(res5$sims[[2]])
par(mfrow=c(2, 2))
plot(res3, "Quotes")
plot(res3, "TV.advert")
plot(res5, "Quotes")
plot(res5, "TV.advert")
# moving block bootstrap
res6 <- ahead::basicf(fpp2::insurance, h=10,
type_pi = "movingblockbootstrap", B=10,
block_length = 4, method = "rw")
par(mfrow=c(1, 2))
plot(res6, "Quotes")
plot(res6, "TV.advert")
} # }