summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-13 19:57:16 +0530
committerSuraj Yerramilli2016-02-13 19:57:16 +0530
commit3acd17605f5e85206da6c9468a70a0020cb9c3c9 (patch)
tree5d420a4dc64c75fff97ba5f3b2c51ce8de9e4d78
parent90f0e1564d9509f9ee8060c9894c3d5b9c937315 (diff)
downloadSysID-R-code-3acd17605f5e85206da6c9468a70a0020cb9c3c9.tar.gz
SysID-R-code-3acd17605f5e85206da6c9468a70a0020cb9c3c9.tar.bz2
SysID-R-code-3acd17605f5e85206da6c9468a70a0020cb9c3c9.zip
minor corrections in iv routine
-rw-r--r--R/iv.R2
1 files changed, 1 insertions, 1 deletions
diff --git a/R/iv.R b/R/iv.R
index 6985c2c..6309846 100644
--- a/R/iv.R
+++ b/R/iv.R
@@ -2,7 +2,6 @@
iv <- function(z,order=c(0,1,0),x=NULL){
y <- outputData(z); u <- inputData(z); N <- dim(y)[1]
na <- order[1];nb <- order[2]; nk <- order[3]
- nb1 <- nb+nk-1 ; n <- max(na,nb1); df <- N-na-nb
if(is.null(x)){
# Initial Guess using ARX
@@ -14,6 +13,7 @@ iv <- function(z,order=c(0,1,0),x=NULL){
}
ivcompute <- function(y,u,x,na,nb,nk,n,N){
+ nb1 <- nb+nk-1 ; n <- max(na,nb1); df <- N-na-nb
padZeros <- function(x,n) c(rep(0,n),x,rep(0,n))
yout <- apply(y,2,padZeros,n=n);
xout <- apply(x,2,padZeros,n=n);