Skip to content

Commit

Permalink
Sort levels in forecast.ets and forecast.Arima
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Oct 25, 2016
1 parent 8a12efe commit d789108
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/arima.R
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ forecast.Arima <- function (object, h=ifelse(object$arma[5] > 1, 2 * object$arma
else if(min(level) < 0 | max(level) > 99.99)
stop("Confidence limit out of range")
}
level <- sort(level)
if(use.drift)
{
n <- length(x)
Expand Down
2 changes: 2 additions & 0 deletions R/etsforecast.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ forecast.ets <- function(object, h=ifelse(object$m>1, 2*object$m, 10),
else if(min(level) < 0 | max(level) > 99.99)
stop("Confidence limit out of range")
}
# Order levels
level <- sort(level)

n <- length(object$x)
damped <- as.logical(object$components[4])
Expand Down

0 comments on commit d789108

Please sign in to comment.