summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NAMESPACE1
-rw-r--r--R/estpoly.R9
2 files changed, 10 insertions, 0 deletions
diff --git a/NAMESPACE b/NAMESPACE
index 203bb55..72ea557 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -4,6 +4,7 @@ S3method(plot,idframe)
S3method(plot,idfrd)
S3method(plot,impulseest)
S3method(predict,detrend)
+S3method(predict,estARX)
S3method(print,arx)
S3method(print,summary.estARX)
S3method(print,summary.idframe)
diff --git a/R/estpoly.R b/R/estpoly.R
index b0e127b..70e98b2 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -30,6 +30,15 @@ estARX <- function(data,order=c(0,1,0)){
}
#' @export
+predict.estARX <- function(model,newdata=NULL){
+ if(is.null(newdata)){
+ return(fitted(model))
+ } else{
+ return(sim(coef(model),newdata))
+ }
+}
+
+#' @export
summary.estARX <- function(object)
{
coefs <- c(coef(object)$A[-1],coef(object)$B)