summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-01-03 09:56:48 +0530
committerSuraj Yerramilli2016-01-03 09:56:48 +0530
commitf262485f677d70bd6b3e0edff65f5e5966271ae2 (patch)
tree461d976b9c3eaf52eb51a9677b4fd648caa1d9cf
parent38f94134e67fcb66cbf70db3074fa36bcff5f1a4 (diff)
downloadSysID-R-code-f262485f677d70bd6b3e0edff65f5e5966271ae2.tar.gz
SysID-R-code-f262485f677d70bd6b3e0edff65f5e5966271ae2.tar.bz2
SysID-R-code-f262485f677d70bd6b3e0edff65f5e5966271ae2.zip
Predictions for OE and Infinite step predictions
-rw-r--r--R/poly.R9
1 files changed, 6 insertions, 3 deletions
diff --git a/R/poly.R b/R/poly.R
index a4e777b..5655a2f 100644
--- a/R/poly.R
+++ b/R/poly.R
@@ -172,9 +172,12 @@ predict.idpoly <- function(x,data,nahead=1){
G <- signal::Arma(b=c(rep(0,x$ioDelay),x$B),
a= as.numeric(polynom::polynomial(x$A)*
polynom::polynomial(x$F1)))
-
- Hden <- as.numeric(polynom::polynomial(x$A)*polynom::polynomial(x$D))
- Hinv <- signal::Arma(b=Hden,a=x$C)
+ if(x$type=="oe" || nahead==Inf){
+ ypred <- signal::filter(G,u)
+ } else{
+ Hden <- as.numeric(polynom::polynomial(x$A)*polynom::polynomial(x$D))
+ Hinv <- signal::Arma(b=Hden,a=x$C)
+ }
return(ypred)
} \ No newline at end of file