summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-29 16:58:16 +0530
committerSuraj Yerramilli2016-02-29 16:58:16 +0530
commit00771932c15e9a20ac65fc9036e93804ba526a05 (patch)
treea00818bae517bea15ca86882425ec4e0c60058ec
parentaed12e7023359986b2f803f7cdb8ce523041e872 (diff)
downloadSysID-R-code-00771932c15e9a20ac65fc9036e93804ba526a05.tar.gz
SysID-R-code-00771932c15e9a20ac65fc9036e93804ba526a05.tar.bz2
SysID-R-code-00771932c15e9a20ac65fc9036e93804ba526a05.zip
correcting the case where nc=0
-rw-r--r--R/estpoly.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/estpoly.R b/R/estpoly.R
index 76686e4..cae8c6b 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -468,7 +468,8 @@ bj <- function(z,order=c(1,1,1,1,0),
theta <- l$params
e <- ts(l$residuals,start = start(y),deltat = deltat(y))
- model <- idpoly(B = theta[1:nb],C=c(1,theta[nb+1:nc]),
+ C_params <- if(nc==0) NULL else theta[nb+1:nc]
+ model <- idpoly(B = theta[1:nb],C=c(1,C_params),
D=c(1,theta[nb+nc+1:nd]),
F1 = c(1,theta[nb+nc+nd+1:nf]),
ioDelay = nk,Ts=deltat(z),noiseVar = l$sigma,unit=z$unit)