Skip to content

Commit

Permalink
Merge c9b5734 into 87aeab7
Browse files Browse the repository at this point in the history
  • Loading branch information
dashaub committed Sep 9, 2015
2 parents 87aeab7 + c9b5734 commit 5351591
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/errors.R
Expand Up @@ -176,7 +176,7 @@ trainingaccuracy <- function(f,test,d, D)

accuracy <- function(f,x,test=NULL,d=NULL,D=NULL)
{
if(!any(is.element(class(f), c("mforecast","forecast","ts","integer","numeric","Arima","ets","lm"))))
if(!any(is.element(class(f), c("mforecast","forecast","ts","integer","numeric","Arima","ets","lm","bats","tbats"))))
stop("First argument should be a forecast object or a time series.")
if(is.element("mforecast", class(f)))
return(accuracy.mforecast(f,x,test,d,D))
Expand Down
12 changes: 12 additions & 0 deletions R/getResponse.R
Expand Up @@ -52,3 +52,15 @@ getResponse.ar <- function(object, ...) {
getResponse.Arima(object)
}

getResponse.tbats <- function(object,..){
if(is.element("y", names(object))){
y <- object$y
} else {
return(NULL)
}
return(as.ts(y))
}

getResponse.bats <- function(object,...){
return(getResponse.tbats(object,...))
}

0 comments on commit 5351591

Please sign in to comment.