summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-08-23 16:28:05 +0530
committerSuraj Yerramilli2015-08-23 16:28:05 +0530
commitfc5b9c365a4ac75137327731df09fa866aaa2d54 (patch)
treef7cfe4a7f95012e8de8768af4cf157f05c2ca0d7
parentc95cf09232ecc5d808f8767354aae061b54e1026 (diff)
downloadSysID-R-code-fc5b9c365a4ac75137327731df09fa866aaa2d54.tar.gz
SysID-R-code-fc5b9c365a4ac75137327731df09fa866aaa2d54.tar.bz2
SysID-R-code-fc5b9c365a4ac75137327731df09fa866aaa2d54.zip
Corrected minor errors
-rw-r--r--R/idframe.R2
-rw-r--r--R/nonparam.R6
2 files changed, 4 insertions, 4 deletions
diff --git a/R/idframe.R b/R/idframe.R
index 9b79245..5a0b338 100644
--- a/R/idframe.R
+++ b/R/idframe.R
@@ -35,7 +35,7 @@ idframe <- function(output=NULL,input=NULL,Ts = 1,start=0,end=NULL,
l3 <- lapply(l,ts,start=start,deltat=Ts)
# Object Constructor
- dat <- list(output=l3[[1]],input=l3[[1]],unit=unit)
+ dat <- list(output=l3[[1]],input=l3[[2]],unit=unit)
class(dat) <- "idframe"
return(dat)
}
diff --git a/R/nonparam.R b/R/nonparam.R
index f3faa26..cebc1ab 100644
--- a/R/nonparam.R
+++ b/R/nonparam.R
@@ -42,15 +42,15 @@ impulseest <- function(x,M=30,K=NULL,regul=F,lambda=1){
for(j in seq(nInputSeries(x))){
index <- (i-1)*nInputSeries(x)+j
out[[index]] <- impulsechannel(outputData(x)[,i,drop=F],
- inputData(x)[,j,drop=F],N,K(index),
- regul,lambda)
+ inputData(x)[,j,drop=F],N,M,
+ K[index],regul,lambda)
}
}
class(out) <- "impulseest"
return(out)
}
-impulsechannel <- function(y,u,N,K=0,regul=F,lambda=1){
+impulsechannel <- function(y,u,N,M,K=0,regul=F,lambda=1){
ind <- (M+K+1):N
z_reg <- function(i) u[(i-K):(i-M-K),]
Z <- t(sapply(ind,z_reg))