summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-12-31 14:19:20 +0530
committerSuraj Yerramilli2015-12-31 14:19:20 +0530
commit22496c19d045f2a41790ad7cc92af0190a2e8173 (patch)
tree71945db4536e75189bf90398558ea55eea68593b
parent957b222a1e66af5757bf9973311c6f8409db44fc (diff)
downloadSysID-R-code-22496c19d045f2a41790ad7cc92af0190a2e8173.tar.gz
SysID-R-code-22496c19d045f2a41790ad7cc92af0190a2e8173.tar.bz2
SysID-R-code-22496c19d045f2a41790ad7cc92af0190a2e8173.zip
added prediction step for ARMAX
-rw-r--r--R/estpoly.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/R/estpoly.R b/R/estpoly.R
index afba0c2..9ae375c 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -63,11 +63,13 @@ predict.estpoly <- function(model,newdata=NULL){
f1 <- signal::Ma(c(rep(0,mod$ioDelay),mod$B))
f2 <- signal::Ma(c(0,-mod$A[-1]))
ypred <- signal::filter(f1,u) + signal::filter(f2,y)
+ } else if(mod$type=="armax"){
+ f1 <- signal::Arma(b=c(rep(0,mod$ioDelay),mod$B),a=mod$C)
+ f2 <- signal::Arma(b=mod$A,a=mod$C)
+ ypred <- signal::filter(f1,u) + y - signal::filter(f2,y)
}
return(ypred)
- } else if(mod$type=="armax"){
-
- }
+ }
}
#' @export