diff options
author | Suraj Yerramilli | 2016-01-04 18:31:50 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2016-01-04 18:31:50 +0530 |
commit | c064ec62ec2c7cf3d761addc8e0495ab82b7ed19 (patch) | |
tree | baf8d49c72cac93f659d16d0072aff6b1737fe36 /R | |
parent | 41ff90bc5b8137201ee09d80a2ea67de6cd5884c (diff) | |
download | SysID-R-code-c064ec62ec2c7cf3d761addc8e0495ab82b7ed19.tar.gz SysID-R-code-c064ec62ec2c7cf3d761addc8e0495ab82b7ed19.tar.bz2 SysID-R-code-c064ec62ec2c7cf3d761addc8e0495ab82b7ed19.zip |
added one-step ahead predictions
Diffstat (limited to 'R')
-rw-r--r-- | R/predict.R | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/R/predict.R b/R/predict.R index 23c6b62..84b64a8 100644 --- a/R/predict.R +++ b/R/predict.R @@ -1,14 +1,20 @@ #' @export predict.idpoly <- function(x,data,nahead=1){ - y <- outputData(z); u<- inputData(z) + y <- outputData(x); u<- inputData(x) G <- signal::Arma(b=c(rep(0,x$ioDelay),x$B), a= as.numeric(polynom::polynomial(x$A)* polynom::polynomial(x$F1))) + det_sys <- signal::filter(G,u) if(x$type=="oe" || nahead==Inf){ - ypred <- signal::filter(G,u) + ypred <- det_sys } else{ Hden <- as.numeric(polynom::polynomial(x$A)*polynom::polynomial(x$D)) - Hinv <- signal::Arma(b=Hden,a=x$C) + Hinv <- signal::Arma(b=Hden,a=x$C) + filtered <- signal::filter(Hinv,y-det_sys) + if(nahead!=1){ + + } + ypred <- y[k] - filtered } return(ypred) @@ -30,3 +36,7 @@ predict.estpoly <- function(x,newdata=NULL,nahead=1){ predict(model,z,nahead) } } + +polyinv <- function(x,k){ + gamma <- 1/Re(polyroot(x)) +}
\ No newline at end of file |