summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-03-16 17:21:09 +0530
committerSuraj Yerramilli2016-03-16 17:21:09 +0530
commit376e62206bb59f426e2d66e7bfecf2ff87ebc4c2 (patch)
treeae9aceddcb1acd99c58984549c6931b8826885a7
parent8dbaf04dc3822ef1985ca91c038446a83184466f (diff)
downloadSysID-R-code-376e62206bb59f426e2d66e7bfecf2ff87ebc4c2.tar.gz
SysID-R-code-376e62206bb59f426e2d66e7bfecf2ff87ebc4c2.tar.bz2
SysID-R-code-376e62206bb59f426e2d66e7bfecf2ff87ebc4c2.zip
Correcting filtering stage in iv4
-rw-r--r--R/iv.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/R/iv.R b/R/iv.R
index f653bc1..006a71f 100644
--- a/R/iv.R
+++ b/R/iv.R
@@ -121,9 +121,8 @@ iv4 <- function(z,order=c(0,1,0)){
# Step 4
# G2 <- signal::Arma(as.numeric(B),as.numeric(A))
- # x2 <- matrix(sim(mod_iv$sys,u))
-
- Lf <- function(x,L) matrix(as.numeric(stats::filter(x,L,method="recursive")))
+ x2 <- matrix(sim(mod_iv$sys,u))
+ Lf <- function(x,L) matrix(as.numeric(stats::filter(x,L,method="convolution",sides=1,circular = T)))
filtered <- lapply(list(y,u,x),Lf,L=Lhat)
yf <- filtered[[1]]; uf<- filtered[[2]]; xf <- filtered[[3]]