summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-29 18:04:25 +0530
committerSuraj Yerramilli2016-02-29 18:04:25 +0530
commite2852219ec1c3572d8a8071670abd41ef9884b72 (patch)
tree21c6f18b30dedf04eea9dd7f0a4a319474ef1562 /R
parentf82e8a3928943fe8814d3e7b20b7bb7baf523dfa (diff)
downloadSysID-R-code-e2852219ec1c3572d8a8071670abd41ef9884b72.tar.gz
SysID-R-code-e2852219ec1c3572d8a8071670abd41ef9884b72.tar.bz2
SysID-R-code-e2852219ec1c3572d8a8071670abd41ef9884b72.zip
minor corrections
Diffstat (limited to 'R')
-rw-r--r--R/iv.R11
1 files changed, 6 insertions, 5 deletions
diff --git a/R/iv.R b/R/iv.R
index 635aacf..5d0a7a6 100644
--- a/R/iv.R
+++ b/R/iv.R
@@ -112,17 +112,18 @@ iv4 <- function(z,order=c(0,1,0)){
# Steps 1-2
mod_iv1 <- iv(z,order)
- A <- signal::Ma(mod_iv1$sys$A)
- B <- signal::Ma(c(rep(0,nk),mod_iv1$sys$B))
+# A <- signal::Ma(mod_iv1$sys$A)
+# B <- signal::Ma(c(rep(0,nk),mod_iv1$sys$B))
# Step 3 (AR Modeling)
- w <- matrix(as.numeric(signal::filter(A,y)) -
- as.numeric(signal::filter(B,u)))
+# 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=na+nb)
Lhat <- signal::Ma(c(1,-mod_ar$ar))
# Step 4
- G2 <- signal::Arma(as.numeric(B),as.numeric(A))
+ # G2 <- signal::Arma(as.numeric(B),as.numeric(A))
x2 <- matrix(sim(mod_iv1$sys,u))
Lf <- function(x,L) matrix(as.numeric(signal::filter(L,x)))