diff options
author | Suraj Yerramilli | 2015-12-31 14:19:20 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-12-31 14:19:20 +0530 |
commit | 22496c19d045f2a41790ad7cc92af0190a2e8173 (patch) | |
tree | 71945db4536e75189bf90398558ea55eea68593b | |
parent | 957b222a1e66af5757bf9973311c6f8409db44fc (diff) | |
download | SysID-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.R | 8 |
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 |