summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-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