summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-06-06 01:03:51 +0530
committerSuraj Yerramilli2015-06-06 01:03:51 +0530
commit770703a5e180ed20a74dc97d4e7a973bc4febe95 (patch)
tree81b9a3059e379f2326a21dfb054d40a71b83e9f7 /R
parentb51c0f543934e4bff2788409af3a13584b710f1c (diff)
downloadSysID-R-code-770703a5e180ed20a74dc97d4e7a973bc4febe95.tar.gz
SysID-R-code-770703a5e180ed20a74dc97d4e7a973bc4febe95.tar.bz2
SysID-R-code-770703a5e180ed20a74dc97d4e7a973bc4febe95.zip
Added predict method for the estimated ARX method
Diffstat (limited to 'R')
-rw-r--r--R/estpoly.R9
1 files changed, 9 insertions, 0 deletions
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)