diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/poly.R | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |