summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-14 00:11:38 +0530
committerSuraj Yerramilli2016-02-14 00:11:38 +0530
commit329f36146737f378283c64f965d88e1802845ca2 (patch)
tree914e26bd0e78e1f3829f27b9b174e979db112bc2 /R
parentd3388b8f77bd280f75e12dd1bb0ad62d5f1a3a19 (diff)
downloadSysID-R-code-329f36146737f378283c64f965d88e1802845ca2.tar.gz
SysID-R-code-329f36146737f378283c64f965d88e1802845ca2.tar.bz2
SysID-R-code-329f36146737f378283c64f965d88e1802845ca2.zip
changed initial estimate for oe from arx to iv4
Diffstat (limited to 'R')
-rw-r--r--R/estpoly.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/estpoly.R b/R/estpoly.R
index 9a52552..d951ad5 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -345,12 +345,12 @@ oe <- function(x,order=c(1,1,0),options=optimOptions()){
stop("Not an OE model")
leftPadZeros <- function(x,n) c(rep(0,n),x)
- mod_arx <- arx(x,c(nf,nb,nk)) # fitting ARX model
- iv <- matrix(predict(mod_arx))
+ mod_arx <- iv4(x,c(nf,nb,nk)) # fitting ARX model
+ ivs <- matrix(predict(mod_arx))
theta0 <- matrix(c(mod_arx$sys$B,mod_arx$sys$A[-1]))
uout <- apply(u,2,leftPadZeros,n=n)
- l <- levbmqdt(y,uout,order,iv,obj=oeGrad,theta0=theta0,N=N,
+ l <- levbmqdt(y,uout,order,ivs,obj=oeGrad,theta0=theta0,N=N,
opt=options)
theta <- l$params
e <- ts(l$residuals,start = start(y),deltat = deltat(y))