summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-05-05 22:36:47 +0530
committerSuraj Yerramilli2016-05-05 22:36:47 +0530
commitbf66a6f2126c3f7d6138eb89cadb04b1e85003a8 (patch)
treefb11e54ebb357e344270b90cbb2005d23e335589 /R
parent832ca9dfeb0c187891e2caf34efb3bc49e5838e2 (diff)
downloadSysID-R-code-bf66a6f2126c3f7d6138eb89cadb04b1e85003a8.tar.gz
SysID-R-code-bf66a6f2126c3f7d6138eb89cadb04b1e85003a8.tar.bz2
SysID-R-code-bf66a6f2126c3f7d6138eb89cadb04b1e85003a8.zip
correcting bug in arx model
Diffstat (limited to 'R')
-rw-r--r--R/estpoly.R6
1 files changed, 5 insertions, 1 deletions
diff --git a/R/estpoly.R b/R/estpoly.R
index ed43671..9e99dae 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -257,7 +257,11 @@ arx <- function(x,order=c(1,1,1),lambda=0.1,intNoise=FALSE,
temp2[eindex,eindex] <- vcov; vcov <- temp2
}
- A = ifelse(na==0,1,coef[1:na])
+ if(na==0){
+ A <- 1
+ } else {
+ A <- c(1,coef[1:na])
+ }
model <- idpoly(A = A,B = coef[na+1:nb],
ioDelay = nk,Ts=deltat(x),noiseVar = sqrt(sigma2),
intNoise=intNoise,unit=x$unit)