Skip to content

Commit 70e55ac

Browse files
Remove contiguity check from forecast.ARIMA
Resolves #430
1 parent 4411495 commit 70e55ac

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

R/arima.R

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -808,22 +808,6 @@ report.ARIMA <- function(object, ...) {
808808
#' @export
809809
forecast.ARIMA <- function(object, new_data = NULL, specials = NULL,
810810
bootstrap = FALSE, times = 5000, ...) {
811-
# Check position of new_data in model history
812-
if(inherits_any(object$tsp$range, c("yearweek", "yearmonth", "yearquarter"))) {
813-
fc_start <- object$tsp$range[2]+round(as.numeric(diff(object$tsp$range)+1)/nrow(object$est), 6)
814-
} else {
815-
# Try to use difftime
816-
interval <- unclass(object$tsp$interval)
817-
interval <- Filter(function(x) x!=0, interval)
818-
time_unit <- switch(names(interval), day = "days", hour = "hours", minute = "mins", second = "secs")
819-
if(!is.null(time_unit)) interval[[1]] <- as.difftime(interval[[1]], units = time_unit)
820-
fc_start <- object$tsp$range[2] + interval[[1]]
821-
}
822-
823-
if (unclass(new_data)[[index_var(new_data)]][1] != fc_start) {
824-
abort("Forecasts from an ARIMA model must start one step beyond the end of the trained data.")
825-
}
826-
827811
if (bootstrap) {
828812
sim <- map(seq_len(times), function(x) generate(object, new_data, specials, bootstrap = TRUE)[[".sim"]]) %>%
829813
transpose() %>%

0 commit comments

Comments
 (0)