summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-03-01 18:46:51 +0530
committerSuraj Yerramilli2016-03-01 18:46:51 +0530
commit59bc59db2392128673a0df875463391f1a5ab18f (patch)
tree9fa2274fa6d29987486e5bba78a45d1efa9ec726 /R
parent376a4fc5eeb85dcc00795151e88160a9c5be741b (diff)
downloadSysID-R-code-59bc59db2392128673a0df875463391f1a5ab18f.tar.gz
SysID-R-code-59bc59db2392128673a0df875463391f1a5ab18f.tar.bz2
SysID-R-code-59bc59db2392128673a0df875463391f1a5ab18f.zip
minor corrections to the iv4 method
Diffstat (limited to 'R')
-rw-r--r--R/iv.R7
1 files changed, 4 insertions, 3 deletions
diff --git a/R/iv.R b/R/iv.R
index 5de0c73..8a64f25 100644
--- a/R/iv.R
+++ b/R/iv.R
@@ -119,12 +119,13 @@ iv4 <- function(z,order=c(0,1,0)){
# w <- matrix(as.numeric(signal::filter(A,y)) -
# as.numeric(signal::filter(B,u)))
w <- resid(mod_iv1)
- mod_ar <- ar(w,aic = F,order=10+na+nb)
- Lhat <- signal::Ma(c(1,-mod_ar$ar))
+ mod_ar <- ar(w,aic = F,order=na+nb)
+ Lhat <- signal::Arma(1,c(1,-mod_ar$ar))
# Step 4
# G2 <- signal::Arma(as.numeric(B),as.numeric(A))
- x2 <- matrix(sim(mod_iv1$sys,u))
+ # x2 <- matrix(sim(mod_iv1$sys,u))
+ x2 <- predict(mod_iv1)
Lf <- function(x,L) matrix(as.numeric(signal::filter(L,x)))
filtered <- lapply(list(y,u,x2),Lf,L=Lhat)